Class: Rails::FmRest::Railtie

Inherits:
Railtie
  • Object
show all
Defined in:
lib/fmrest/railtie.rb

Class Method Summary collapse

Class Method Details

.rescue_responsesObject

Mapping of rescued exceptions to HTTP responses

@ return [Hash] rescued responses

Examples:

railtie.rescue_responses


14
15
16
17
18
19
20
21
# File 'lib/fmrest/railtie.rb', line 14

def self.rescue_responses
  {
    "FmRest::APIError::RecordMissingError"     => :not_found,
    "FmRest::APIError::NoMatchingRecordsError" => :not_found,
    "FmRest::APIError::ValidationError"        => :unprocessable_entity,
    "FmRest::Spyke::ValidationError"           => :unprocessable_entity,
  }
end