grpc client/server fixes (#1355)
* grpc client/server fixes Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -115,3 +115,22 @@ func InternalServerError(id, format string, a ...interface{}) error {
|
||||
Status: http.StatusText(500),
|
||||
}
|
||||
}
|
||||
|
||||
func Equal(err1 error, err2 error) bool {
|
||||
verr1, ok1 := err1.(*Error)
|
||||
verr2, ok2 := err2.(*Error)
|
||||
|
||||
if ok1 != ok2 {
|
||||
return false
|
||||
}
|
||||
|
||||
if !ok1 {
|
||||
return err1 == err2
|
||||
}
|
||||
|
||||
if verr1.Code != verr2.Code {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user