Skip to content

Commit b4da19d

Browse files
TCIE login fix (#1348)
* Fix TCIE login issue ship:docker
1 parent 4c2e0da commit b4da19d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/travis/api/app.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ def initialize(options = {})
110110
use Travis::Api::App::Middleware::RequestId
111111
use Travis::Api::App::Middleware::ErrorHandler
112112

113+
# puts "is it enterprise? #{Travis::Api::App.enterprise?}"
113114
if Travis::Api::App.use_monitoring?
114115
use Rack::Config do |env|
115116
if env['HTTP_X_REQUEST_ID']
116117
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?
118119
end
119120
end
120121
end
@@ -184,7 +185,9 @@ def initialize(options = {})
184185
def call(env)
185186
#app.after { ActiveRecord::Base.clear_active_connections! }
186187
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")}")
188191
if Endpoint.production?
189192
[500, {'Content-Type' => 'application/json'}, [ERROR_RESPONSE]]
190193
else
@@ -194,7 +197,7 @@ def call(env)
194197

195198
private
196199

197-
def enterprise?
200+
def self.enterprise?
198201
!!Travis.config.enterprise
199202
end
200203

lib/travis/api/app/middleware/error_handler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class ErrorHandler < Struct.new(:app)
99
def call(env)
1010
app.call(env)
1111
rescue Exception => e
12+
# puts("Debug issue 'app.middleware': #{e.message}")
13+
# puts("Backtrace:\n\t#{e.backtrace.join("\n\t")}")
1214
Sentry.capture_exception(e)
1315
raise if Travis.testing
1416

0 commit comments

Comments
 (0)