From bbb17ea1ea619664b362a9c984da45b940c412a2 Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Sun, 7 Apr 2019 07:51:36 +0000 Subject: Handle possible HTTP exception for Sentry client Prior this commit exceptions raised during a HTTP request weren't caught by the Sentry client and were passed to the user. In addition the Sentry client tried to catch a non-existent error `Sentry::Client::SentryError`. Now, the Sentry client catches all possible errors coming from a HTTP request. --- app/services/error_tracking/list_projects_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/services/error_tracking/list_projects_service.rb b/app/services/error_tracking/list_projects_service.rb index 4e92353a13c..8d08f0cda94 100644 --- a/app/services/error_tracking/list_projects_service.rb +++ b/app/services/error_tracking/list_projects_service.rb @@ -15,8 +15,8 @@ module ErrorTracking result = setting.list_sentry_projects rescue Sentry::Client::Error => e return error(e.message, :bad_request) - rescue Sentry::Client::SentryError => e - return error(e.message, :unprocessable_entity) + rescue Sentry::Client::MissingKeysError => e + return error(e.message, :internal_server_error) end success(projects: result[:projects]) -- cgit v1.2.1