module Arrays::ErrorHandler

Public Instance Methods

catch() { || ... } click to toggle source
# File lib/liquid-arrays/error_handler.rb, line 15
def catch
  begin
    yield
  rescue => e
    handle(e)
  end
end
handle(error) click to toggle source
# File lib/liquid-arrays/error_handler.rb, line 3
def handle(error)
  error.line_number = line_number
  error.markup_context = "in \"#{@markup.strip}\""
  
  case @parse_context.error_mode
  when :strict
    raise error
  when :warn
    @parse_context.warnings << error
  end
end