Include template name with line numbers in render errors.

This commit is contained in:
Dylan Thacker-Smith
2015-06-04 13:44:01 -04:00
parent c82e04f4e6
commit ad3748af21
4 changed files with 45 additions and 16 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
module Liquid
class Error < ::StandardError
attr_accessor :line_number
attr_accessor :template_name
attr_accessor :markup_context
def to_s(with_prefix = true)
@@ -41,7 +42,9 @@ module Liquid
end
if line_number
str << " (line #{line_number})"
str << " ("
str << template_name << " " if template_name
str << "line " << line_number.to_s << ")"
end
str << ": "