projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3cbeea
)
Give the API error handler a generic rescue that returns 500 with
author
Tom Hughes
<tom@compton.nu>
Thu, 21 May 2009 10:02:26 +0000
(10:02 +0000)
committer
Tom Hughes
<tom@compton.nu>
Thu, 21 May 2009 10:02:26 +0000
(10:02 +0000)
the exception details.
app/controllers/application.rb
patch
|
blob
|
history
diff --git
a/app/controllers/application.rb
b/app/controllers/application.rb
index f166df21d6075be39651f9350e54106e3f85703b..2f8bd776dd71c22e1e40e5ab05e628126117bf03 100644
(file)
--- a/
app/controllers/application.rb
+++ b/
app/controllers/application.rb
@@
-115,6
+115,8
@@
class ApplicationController < ActionController::Base
rescue OSM::APIError => ex
render_opts = ex.render_opts
report_error render_opts[:text], render_opts[:status]
+ rescue Exception => ex
+ render :text => "#{ex.class}: #{ex.message}", :status => :internal_server_error
end
end