rpcserver: adds NOT_FOUND status code for LookupInvoice
This commit is contained in:
1 parent
7970ffcc2a
commit
2e4318b0ad
1 file changed
+4
-1
+4
-1
@@ -5080,7 +5080,10 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
|
|||||||
rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:])
|
rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:])
|
||||||
|
|
||||||
invoice, err := r.server.invoices.LookupInvoice(payHash)
|
invoice, err := r.server.invoices.LookupInvoice(payHash)
|
||||||
if err != nil {
|
switch {
|
||||||
|
case err == channeldb.ErrInvoiceNotFound:
|
||||||
|
return nil, status.Error(codes.NotFound, err.Error())
|
||||||
|
case err != nil:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user