Exception: Filterameter::DeclarationErrors::UnexpectedError

Inherits:
DeclarationError
  • Object
show all
Defined in:
lib/filterameter/declaration_errors/unexpected_error.rb

Overview

# Unexpected Error

Error UnexpectedError occurs when the filter or scope factory raises an exception that the validator did not expect.

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ UnexpectedError

Returns a new instance of UnexpectedError.



10
11
12
13
14
15
16
17
18
19
# File 'lib/filterameter/declaration_errors/unexpected_error.rb', line 10

def initialize(error)
  super(<<~ERROR)
    The previous error was unexpected. It occurred during while building a filter or sort (see below). Please
    report this to the library so that the error can be handled and provide clearer feedback about what is wrong
    with the declaration.

    #{error.message}
      #{error.backtrace.join("\n\t")}
  ERROR
end