lib/timeliness/format.rb in timeliness-0.3.3 vs lib/timeliness/format.rb in timeliness-0.3.4

- old
+ new

@@ -1,6 +1,8 @@ module Timeliness + class CompilationError < StandardError; end + class Format include Helpers attr_reader :format_string, :regexp, :regexp_string, :token_count @@ -37,10 +39,10 @@ define_process_method(token_order.compact) @regexp_string = format @regexp = Regexp.new("^(#{format})$") self rescue => ex - raise "The format '#{format_string}' failed to compile using regexp string #{format}. Error: #{ex.inspect}" + raise CompilationError, "The format '#{format_string}' failed to compile using regexp string #{format}. Error message: #{ex.inspect}" end # Redefined on compile def process(*args); end