Module: Kraftwerk::Endpoint::ErrorHandling::ClassMethods

Defined in:
lib/kraftwerk/endpoint/error_handling.rb

Instance Method Summary collapse

Instance Method Details

#handle_exception(exception_class, code: 422, message: nil) ⇒ Object



31
32
33
34
# File 'lib/kraftwerk/endpoint/error_handling.rb', line 31

def handle_exception(exception_class, code: 422, message: nil)
  body = message || Proc.new
  self.exception_handlers[exception_class] = { code: code, message: body }
end