mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
feat: add error type
This commit is contained in:
parent
0715ab52ad
commit
e28b354d5f
@ -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 v, ok := errResp.(error); ok && v != nil {
|
||||||
if !reflect.ValueOf(v).IsNil() {
|
if !reflect.ValueOf(v).IsNil() {
|
||||||
stats.ErrorCode = 1
|
stats.ErrorCode = 1
|
||||||
|
stats.ErrorType = fmt.Sprintf("%T", v)
|
||||||
stats.ErrorMessage = v.Error()
|
stats.ErrorMessage = v.Error()
|
||||||
if v, ok := v.(interface {
|
if v, ok := v.(interface {
|
||||||
ErrorCode() int
|
ErrorCode() int
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user