errwithstatus
This commit is contained in:
@ -576,7 +576,11 @@ func (rt *RpcReturnError) WithCode(code int) *RpcReturnError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rt *RpcReturnError) WithError(err error) *RpcReturnError {
|
func (rt *RpcReturnError) WithError(err error) *RpcReturnError {
|
||||||
|
if err2, ok := err.(*ErrorWithStatus); ok {
|
||||||
|
rt.WithCode(err2.StatusCode)
|
||||||
|
} else {
|
||||||
rt.err = err
|
rt.err = err
|
||||||
|
}
|
||||||
return rt
|
return rt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user