summaryrefslogtreecommitdiff
path: root/app/services/metrics/dashboard/base_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/metrics/dashboard/base_service.rb')
-rw-r--r--app/services/metrics/dashboard/base_service.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/services/metrics/dashboard/base_service.rb b/app/services/metrics/dashboard/base_service.rb
index b331bf51874..8a42675c66d 100644
--- a/app/services/metrics/dashboard/base_service.rb
+++ b/app/services/metrics/dashboard/base_service.rb
@@ -5,17 +5,14 @@
module Metrics
module Dashboard
class BaseService < ::BaseService
- PROCESSING_ERROR = Gitlab::Metrics::Dashboard::Stages::BaseStage::DashboardProcessingError
- NOT_FOUND_ERROR = Gitlab::Template::Finders::RepoTemplateFinder::FileNotFoundError
+ include Gitlab::Metrics::Dashboard::Errors
def get_dashboard
return error('Insufficient permissions.', :unauthorized) unless allowed?
success(dashboard: process_dashboard)
- rescue NOT_FOUND_ERROR
- error("#{dashboard_path} could not be found.", :not_found)
- rescue PROCESSING_ERROR => e
- error(e.message, :unprocessable_entity)
+ rescue StandardError => e
+ handle_errors(e)
end
# Summary of all known dashboards for the service.