From 374a2415d945eda27260c2863aa02112d3e6f88f Mon Sep 17 00:00:00 2001 From: Vishal Sharma Date: Thu, 5 May 2022 13:58:39 +0530 Subject: [PATCH] fix: fix typo and return empty struct instead of null (#1092) --- .../app/clickhouseReader/reader.go | 2 +- pkg/query-service/model/response.go | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.go index 7a93791333..a8b60c4503 100644 --- a/pkg/query-service/app/clickhouseReader/reader.go +++ b/pkg/query-service/app/clickhouseReader/reader.go @@ -2503,7 +2503,7 @@ func (r *ClickHouseReader) GetErrorForId(ctx context.Context, queryParams *model if len(getErrorWithSpanReponse) > 0 { return &getErrorWithSpanReponse[0], nil } else { - return nil, &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("Error ID not found")} + return &model.ErrorWithSpan{}, &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("Error ID not found")} } } diff --git a/pkg/query-service/model/response.go b/pkg/query-service/model/response.go index 7df195dcc8..959e2b23d4 100644 --- a/pkg/query-service/model/response.go +++ b/pkg/query-service/model/response.go @@ -328,15 +328,15 @@ type Error struct { } type ErrorWithSpan struct { - ErrorID string `json:"errorId" ch:"errorID"` - ExceptionType string `json:"exceptionType" ch:"exceptionType"` - ExcepionStacktrace string `json:"excepionStacktrace" ch:"excepionStacktrace"` - ExceptionEscaped string `json:"exceptionEscaped" ch:"exceptionEscaped"` - ExceptionMsg string `json:"exceptionMessage" ch:"exceptionMessage"` - Timestamp time.Time `json:"timestamp" ch:"timestamp"` - SpanID string `json:"spanID" ch:"spanID"` - TraceID string `json:"traceID" ch:"traceID"` - ServiceName string `json:"serviceName" ch:"serviceName"` - NewerErrorID string `json:"newerErrorId" ch:"newerErrorId"` - OlderErrorID string `json:"olderErrorId" ch:"olderErrorId"` + ErrorID string `json:"errorId" ch:"errorID"` + ExceptionType string `json:"exceptionType" ch:"exceptionType"` + ExceptionStacktrace string `json:"exceptionStacktrace" ch:"exceptionStacktrace"` + ExceptionEscaped string `json:"exceptionEscaped" ch:"exceptionEscaped"` + ExceptionMsg string `json:"exceptionMessage" ch:"exceptionMessage"` + Timestamp time.Time `json:"timestamp" ch:"timestamp"` + SpanID string `json:"spanID" ch:"spanID"` + TraceID string `json:"traceID" ch:"traceID"` + ServiceName string `json:"serviceName" ch:"serviceName"` + NewerErrorID string `json:"newerErrorId" ch:"newerErrorId"` + OlderErrorID string `json:"olderErrorId" ch:"olderErrorId"` }