diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-04-07 07:51:36 +0000 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-04-07 07:51:36 +0000 |
commit | bbb17ea1ea619664b362a9c984da45b940c412a2 (patch) | |
tree | 617df6d7bd4186c7f1eec0374e975375323d20b9 /app/services/error_tracking | |
parent | ae91b3219aa0b5de20e3452126384341acef75c6 (diff) | |
download | gitlab-ce-bbb17ea1ea619664b362a9c984da45b940c412a2.tar.gz |
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.
Diffstat (limited to 'app/services/error_tracking')
-rw-r--r-- | app/services/error_tracking/list_projects_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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]) |