X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b36138dd447b5ff557cfbb0e00c28899a9c3af17..e22d3dc998f55e3c21125b1a1be7240f89c23dd6:/services/api/app/controllers/application_controller.rb diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index d5bc3f35d7..369043e780 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -140,8 +140,13 @@ class ApplicationController < ActionController::Base def render_error(e) logger.error e.inspect - if !e.is_a? RequestError and (e.respond_to? :backtrace and e.backtrace) - logger.error e.backtrace.collect { |x| x + "\n" }.join('') + if e.respond_to? :backtrace and e.backtrace + # This will be cleared by lograge after adding it to the log. + # Usually lograge would get the exceptions, but in our case we're catching + # all of them with exception handlers that cannot re-raise them because they + # don't get propagated. + Thread.current[:exception] = e.inspect + Thread.current[:backtrace] = e.backtrace.collect { |x| x + "\n" }.join('') end if (@object.respond_to? :errors and @object.errors.andand.full_messages.andand.any?) @@ -428,7 +433,7 @@ class ApplicationController < ActionController::Base end def disable_api_methods - if Rails.configuration.API.DisabledAPIs.include?(controller_name + "." + action_name) + if Rails.configuration.API.DisabledAPIs[controller_name + "." + action_name] send_error("Disabled", status: 404) end end