rpcserver: return consistent grpc NotFound error for GetChaninfo
So that we can properly convert this NotFound error back to our `graphdb.ErrEdgeNotFound` error if we are making this call to another node via RPC.
This commit is contained in:
1 parent
4fef0f4d7a
commit
7a52b6ca5e
1 file changed
+4
-1
+4
-1
@@ -6989,7 +6989,10 @@ func (r *rpcServer) GetChanInfo(_ context.Context,
|
|||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("specify either chan_id or chan_point")
|
return nil, fmt.Errorf("specify either chan_id or chan_point")
|
||||||
}
|
}
|
||||||
if err != nil {
|
switch {
|
||||||
|
case errors.Is(err, graphdb.ErrEdgeNotFound):
|
||||||
|
return nil, status.Error(codes.NotFound, err.Error())
|
||||||
|
case err != nil:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user