class Regexp::Scanner::ValidationError
Base for all scanner validation errors
Public Class Methods
Source
# File lib/regexp_parser/scanner/errors/validation_error.rb, line 7 def self.for(type, problem, reason = nil) types.fetch(type).new(problem, reason) end
Centralizes and unifies the handling of validation related errors.
Source
# File lib/regexp_parser/scanner/errors/validation_error.rb, line 11 def self.types @types ||= { backref: InvalidBackrefError, group: InvalidGroupError, group_option: InvalidGroupOption, posix_class: UnknownPosixClassError, property: UnknownUnicodePropertyError, sequence: InvalidSequenceError, } end