fix: fix typo and return empty struct instead of null (#1092)

This commit is contained in:
Vishal Sharma 2022-05-05 13:58:39 +05:30 committed by GitHub
parent 3789e25a1e
commit 374a2415d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -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")}
}
}

View File

@ -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"`
}