lib/liquid/template.rb in liquid-4.0.0.rc3 vs lib/liquid/template.rb in liquid-4.0.0
- old
+ new
@@ -67,10 +67,15 @@
# :lax is the default, and ignores the taint flag completely
# :warn adds a warning, but does not interrupt the rendering
# :error raises an error when tainted output is used
attr_writer :taint_mode
+ attr_accessor :default_exception_renderer
+ Template.default_exception_renderer = lambda do |exception|
+ exception
+ end
+
def file_system
@@file_system
end
def file_system=(obj)
@@ -165,11 +170,11 @@
context = case args.first
when Liquid::Context
c = args.shift
if @rethrow_errors
- c.exception_handler = ->(e) { raise }
+ c.exception_renderer = ->(e) { raise }
end
c
when Liquid::Drop
drop = args.shift
@@ -239,10 +244,10 @@
end
def apply_options_to_context(context, options)
context.add_filters(options[:filters]) if options[:filters]
context.global_filter = options[:global_filter] if options[:global_filter]
- context.exception_handler = options[:exception_handler] if options[:exception_handler]
+ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer]
context.strict_variables = options[:strict_variables] if options[:strict_variables]
context.strict_filters = options[:strict_filters] if options[:strict_filters]
end
end
end