TUN-3107: UnregisterConnection shouldn't wrap nil error as RPC error

This commit is contained in:
cthuang 2020-06-18 21:17:43 +08:00
parent 4d3ebaf984
commit 3886021ba5
2 changed files with 10 additions and 4 deletions

View File

@ -229,5 +229,8 @@ func (c TunnelServer_PogsClient) Unregister(ctx context.Context) error {
return nil return nil
}) })
_, err := promise.Struct() _, err := promise.Struct()
if err != nil {
return wrapRPCError(err) return wrapRPCError(err)
} }
return nil
}

View File

@ -37,10 +37,13 @@ func (re *RPCError) Error() string {
} }
func wrapRPCError(err error) *RPCError { func wrapRPCError(err error) *RPCError {
if err != nil {
return &RPCError{ return &RPCError{
err: err, err: err,
} }
} }
return nil
}
func newRPCError(format string, args ...interface{}) *RPCError { func newRPCError(format string, args ...interface{}) *RPCError {
return &RPCError{ return &RPCError{