mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-22 23:03:43 +02:00
rpcserver: adds NOT_FOUND status code for LookupInvoice
This commit is contained in:
parent
7970ffcc2a
commit
2e4318b0ad
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user