Permalink
Browse files

Sinatra service has good error messages

  • Loading branch information...
1 parent 0efa366 commit 038068d5a8cccd461b444c384284ebc3f3c25ab7 David Stevenson and Matt Royal committed Apr 11, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 sinatra/app_sinatra_service/main.rb
@@ -54,6 +54,16 @@
'This is nowhere to be found.'
end
+error do
+ error = env['sinatra.error']
+<<TEXT
+#{error.inspect}
+
+Backtrace:
+ #{error.backtrace.join("\n ")}
+TEXT
+end
+
post '/service/mysql/:key' do
client = load_mysql
value = request.env["rack.input"].read

0 comments on commit 038068d

Please sign in to comment.