Skip to content

Commit c4a6987

Browse files
committed
Update error handling for keeping backward-compatibility on error messages in the render tag
1 parent eab457f commit c4a6987

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/liquid/locales/en.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,3 @@
3434
render: "Argument error in tag 'render' - Dynamically chosen templates are not allowed"
3535
disabled:
3636
tag: "usage is not allowed in this context"
37-
file_system:
38-
includes: "This liquid context does not allow includes"

lib/liquid/tags/render.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def render_tag(context, output)
5858
template_name = partial.name
5959
context_variable_name = @alias_name || template_name.split('/').last
6060
else
61-
raise Liquid::ArgumentError, parse_context.locale.t("errors.file_system.includes")
61+
raise ::ArgumentError
6262
end
6363

6464
render_partial_func = ->(var, forloop) {

test/integration/tags/snippet_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def test_render_with_non_existent_tag
494494
495495
496496
497-
Liquid error (index line 2): This liquid context does not allow includes
497+
Liquid error (index line 2): internal
498498
TEXT
499499
template.name = "index"
500500

@@ -518,7 +518,7 @@ def test_render_handles_errors
518518
519519
520520
521-
Liquid error (index line 2): This liquid context does not allow includes will raise an error.
521+
Liquid error (index line 2): internal will raise an error.
522522
523523
Bla bla test.
524524
@@ -1017,7 +1017,7 @@ def test_render_with_non_existent_tag
10171017
10181018
10191019
1020-
Liquid error (index line 2): This liquid context does not allow includes
1020+
Liquid error (index line 2): internal
10211021
TEXT
10221022
template.name = "index"
10231023

@@ -1041,7 +1041,7 @@ def test_render_handles_errors
10411041
10421042
10431043
1044-
Liquid error (index line 2): This liquid context does not allow includes will raise an error.
1044+
Liquid error (index line 2): internal will raise an error.
10451045
10461046
Bla bla test.
10471047

0 commit comments

Comments
 (0)