1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Wrap error for filter compiler

This commit is contained in:
Takashi Kokubun 2015-10-12 10:06:34 +09:00
parent 37a9ddc4ff
commit 17a358f994
2 changed files with 5 additions and 2 deletions

View file

@ -74,7 +74,7 @@ namespace :benchmark do
haml_benchmark.capture(haml_time)
faml_benchmark.capture(faml_time)
hamlit_benchmark.capture(hamlit_time)
rescue Temple::FilterError, TypeError
rescue Temple::FilterError, TypeError, Hamlit::FilterCompiler::NotFound
end
end
end

View file

@ -4,6 +4,9 @@ module Hamlit
class FilterCompiler
@registered = {}
class NotFound < RuntimeError
end
class << self
attr_reader :registered
@ -24,7 +27,7 @@ module Hamlit
def find_compiler(name)
compiler = FilterCompiler.registered[name.to_sym]
raise "FilterCompiler for '#{name}' was not found" unless compiler
raise NotFound.new("FilterCompiler for '#{name}' was not found") unless compiler
compiler
end