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:
Torkel Rogstad authored and Elle Mouton committed 2025-07-10 11:21:31 +02:00
1 parent 4fef0f4d7a
commit 7a52b6ca5e
1 file changed
+4 -1
+4 -1
View File
@@ -6989,7 +6989,10 @@ func (r *rpcServer) GetChanInfo(_ context.Context,
default:
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
}