From a314f1df9c3e2434827109ac934434aabc446b18 Mon Sep 17 00:00:00 2001 From: Sithum Sathsara <89584440+SithumSathsaras@users.noreply.github.com> Date: Fri, 18 Oct 2024 02:57:05 -0400 Subject: [PATCH] Fixed Issue: #2195 500 error More inractive Signed-off-by: Sithum Sathsara <89584440+SithumSathsaras@users.noreply.github.com> --- pkg/metrics/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/metrics/prometheus.go b/pkg/metrics/prometheus.go index 6603d06ddb..d3c0d08ba1 100644 --- a/pkg/metrics/prometheus.go +++ b/pkg/metrics/prometheus.go @@ -293,7 +293,7 @@ func (pc *prometheusCollector) MeasureGraphQLResponseDuration(next http.Handler) OperationName string `json:"operationName"` } if !json.Valid(bodyCopy) { // Check if the body is valid JSON - err_msg := fmt.Sprintf("Provided input json couldn't be parsed. likely it was empty or was wrongly structured; error message: %v", err.Error()) + err_msg := fmt.Sprintf("The JSON parsing failed due to the following error: '%v'. Please review your input for syntax errors or missing elements.", err.Error()) http.Error(w, err_msg, http.StatusBadRequest) return }