feat: add error type

This commit is contained in:
franklin 2023-07-11 08:11:52 +02:00
parent 0715ab52ad
commit e28b354d5f
2 changed files with 2 additions and 0 deletions

View File

@ -114,6 +114,7 @@ func Reply(response []interface{}, stats *CallStats, r *http.Request, w http.Res
if v, ok := errResp.(error); ok && v != nil {
if !reflect.ValueOf(v).IsNil() {
stats.ErrorCode = 1
stats.ErrorType = fmt.Sprintf("%T", v)
stats.ErrorMessage = v.Error()
if v, ok := v.(interface {
ErrorCode() int

View File

@ -12,5 +12,6 @@ type CallStats struct {
RequestSize int
ResponseSize int
ErrorCode int
ErrorType string
ErrorMessage string
}