diff --git a/lib/travis/api/app.rb b/lib/travis/api/app.rb index 7a06db03..f242ce93 100644 --- a/lib/travis/api/app.rb +++ b/lib/travis/api/app.rb @@ -10,6 +10,8 @@ require 'rack/contrib' require 'active_record' require 'redis' require 'gh' +require 'hubble' +require 'hubble/middleware' # Rack class implementing the HTTP API. # Instances respond to #call. @@ -51,6 +53,7 @@ class Travis::Api::App def initialize @app = Rack::Builder.app do + use Hubble::Rescuer, env: Travis.env, codename: ENV['CODENAME'] if Endpoint.production? && ENV['HUBBLE_ENDPOINT'] use Rack::Protection::PathTraversal use Rack::SSL if Endpoint.production? use Rack::JSONP diff --git a/lib/travis/api/app/responder.rb b/lib/travis/api/app/responder.rb index db20f7ef..6fc6bcff 100644 --- a/lib/travis/api/app/responder.rb +++ b/lib/travis/api/app/responder.rb @@ -20,6 +20,8 @@ class Travis::Api::App # # Logging is set up by custom middleware disable :protection, :logging, :setup + enable :raise_errors + disable :dump_errors register :subclass_tracker helpers :json_renderer end