This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Raise database errors in test env

  • Loading branch information...
Jesse Stuart
Jesse Stuart committed Dec 14, 2012
1 parent bbb2230 commit 133201469db7b4a23104ce112f39763e17119593
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/tentd/api/middleware.rb
@@ -20,7 +20,9 @@ def call(env)
rescue Unauthorized
error_response(403, 'Unauthorized')
rescue Sequel::DatabaseError => e
- if defined?(Airbrake)
+ if ENV['RACK_ENV'] == 'test'
+ raise
+ elsif defined?(Airbrake)
Airbrake.notify_or_ignore(e, :rack_env => env)
end
error_response(422, 'Invalid Attributes')

0 comments on commit 1332014

Please sign in to comment.