File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,12 @@ def initialize(options = {})
110
110
use Travis ::Api ::App ::Middleware ::RequestId
111
111
use Travis ::Api ::App ::Middleware ::ErrorHandler
112
112
113
+ # puts "is it enterprise? #{Travis::Api::App.enterprise?}"
113
114
if Travis ::Api ::App . use_monitoring?
114
115
use Rack ::Config do |env |
115
116
if env [ 'HTTP_X_REQUEST_ID' ]
116
117
Sentry . with_scope do |scope |
117
- scope . set_tags ( request_id : env [ 'HTTP_X_REQUEST_ID' ] ) unless enterprise?
118
+ scope . set_tags ( request_id : env [ 'HTTP_X_REQUEST_ID' ] ) unless Travis :: Api :: App . enterprise?
118
119
end
119
120
end
120
121
end
@@ -184,7 +185,9 @@ def initialize(options = {})
184
185
def call ( env )
185
186
#app.after { ActiveRecord::Base.clear_active_connections! }
186
187
app . call ( env )
187
- rescue
188
+ rescue => e
189
+ # puts("Debug error 'app.call': #{e.message}")
190
+ # puts("Backtrace:\n\t#{e.backtrace.join("\n\t")}")
188
191
if Endpoint . production?
189
192
[ 500 , { 'Content-Type' => 'application/json' } , [ ERROR_RESPONSE ] ]
190
193
else
@@ -194,7 +197,7 @@ def call(env)
194
197
195
198
private
196
199
197
- def enterprise?
200
+ def self . enterprise?
198
201
!!Travis . config . enterprise
199
202
end
200
203
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ class ErrorHandler < Struct.new(:app)
9
9
def call ( env )
10
10
app . call ( env )
11
11
rescue Exception => e
12
+ # puts("Debug issue 'app.middleware': #{e.message}")
13
+ # puts("Backtrace:\n\t#{e.backtrace.join("\n\t")}")
12
14
Sentry . capture_exception ( e )
13
15
raise if Travis . testing
14
16
You can’t perform that action at this time.
0 commit comments