Skip to content

Commit

Permalink
fixes syntax error in rescue responses
Browse files Browse the repository at this point in the history
syntax error in rescue response declarations for rails < 3.2 was
causing MongoMapper::DocumentNotFound exceptions to cause an exception
in WebBrick's exception handling in development.
  • Loading branch information
bsoule committed Jun 24, 2014
1 parent f30e11e commit fb57604
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mongo_mapper/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class Railtie < Rails::Railtie
# Rescue responses similar to ActiveRecord.
# For rails 3.0 and 3.1
if Rails.version < "3.2"
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::DocumentNotFound'] = :not_found,
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::InvalidKey'] = :unprocessable_entity,
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::InvalidScheme'] = :unprocessable_entity,
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::DocumentNotFound'] = :not_found
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::InvalidKey'] = :unprocessable_entity
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::InvalidScheme'] = :unprocessable_entity
ActionDispatch::ShowExceptions.rescue_responses['MongoMapper::NotSupported'] = :unprocessable_entity
else
# For rails 3.2 and 4.0
Expand Down

1 comment on commit fb57604

@leifcr
Copy link
Contributor

@leifcr leifcr commented on fb57604 Jun 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the typo and thanks for the fix.

Please sign in to comment.