Skip to content
Snippets Groups Projects
Commit b97fad8e authored by Mark Fletcher's avatar Mark Fletcher
Browse files

Return chart loading errors for display

parent cded4348
No related merge requests found
......@@ -6,6 +6,9 @@ module InsightsActions
included do
before_action :check_insights_available!
before_action :validate_params, only: [:query]
rescue_from Gitlab::Insights::Validators::ParamsValidator::ParamsValidatorError,
Gitlab::Insights::Finders::IssuableFinder::IssuableFinderError, with: :render_insights_chart_error
end
def show
......@@ -69,4 +72,8 @@ def serializer(chart_type)
def config_data
insights_entity.insights_config
end
def render_insights_chart_error(exception)
render json: { message: exception.message }, status: 422
end
end
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment