From 7a52b6ca5e1b18e9fee831d19fd1798dc9cd0de4 Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Thu, 10 Jul 2025 11:12:45 +0200 Subject: [PATCH] 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. --- rpcserver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index 7b6a5499e..5a8eede0f 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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 }