mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
rpcserver: adds NOT_FOUND status code for LookupInvoice
This commit is contained in:
parent
7970ffcc2a
commit
2e4318b0ad
1 changed files with 4 additions and 1 deletions
|
@ -5080,7 +5080,10 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
|
|||
rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", 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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue