diff --git a/tunnelrpc/pogs/connectionrpc.go b/tunnelrpc/pogs/connectionrpc.go index 971f5393..9327eea3 100644 --- a/tunnelrpc/pogs/connectionrpc.go +++ b/tunnelrpc/pogs/connectionrpc.go @@ -229,5 +229,8 @@ func (c TunnelServer_PogsClient) Unregister(ctx context.Context) error { return nil }) _, err := promise.Struct() - return wrapRPCError(err) + if err != nil { + return wrapRPCError(err) + } + return nil } diff --git a/tunnelrpc/pogs/errors.go b/tunnelrpc/pogs/errors.go index 7fd2a497..d64ab5e9 100644 --- a/tunnelrpc/pogs/errors.go +++ b/tunnelrpc/pogs/errors.go @@ -37,9 +37,12 @@ func (re *RPCError) Error() string { } func wrapRPCError(err error) *RPCError { - return &RPCError{ - err: err, + if err != nil { + return &RPCError{ + err: err, + } } + return nil } func newRPCError(format string, args ...interface{}) *RPCError { @@ -50,4 +53,4 @@ func newRPCError(format string, args ...interface{}) *RPCError { func (re *RPCError) Unwrap() error { return re.err -} \ No newline at end of file +}