mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
parse token
This commit is contained in:
parent
970e6c40b4
commit
f2d33991e1
@ -2,7 +2,6 @@ package apiresp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"OpenIM/pkg/errs"
|
"OpenIM/pkg/errs"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type apiResponse struct {
|
type apiResponse struct {
|
||||||
@ -22,7 +21,7 @@ func apiError(err error) *apiResponse {
|
|||||||
unwrap := errs.Unwrap(err)
|
unwrap := errs.Unwrap(err)
|
||||||
var dlt string
|
var dlt string
|
||||||
if unwrap != err {
|
if unwrap != err {
|
||||||
dlt = fmt.Sprintf("%+v", dlt)
|
dlt = err.Error()
|
||||||
}
|
}
|
||||||
if codeErr, ok := unwrap.(errs.CodeError); ok {
|
if codeErr, ok := unwrap.(errs.CodeError); ok {
|
||||||
return &apiResponse{ErrCode: codeErr.Code(), ErrMsg: codeErr.Msg(), ErrDlt: dlt}
|
return &apiResponse{ErrCode: codeErr.Code(), ErrMsg: codeErr.Msg(), ErrDlt: dlt}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user