lncli: returning non 0 exit code when paying invoice fails

This commit is contained in:
Max Kaplan 2019-02-17 15:09:15 -05:00
parent 44b8cd6699
commit 9bfb8224cd
No known key found for this signature in database
GPG Key ID: 0915064708136E60

@ -2176,6 +2176,13 @@ func sendPaymentRequest(client lnrpc.LightningClient, req *lnrpc.SendRequest) er
R: resp.PaymentRoute, R: resp.PaymentRoute,
}) })
// If we get a payment error back, we pass an error
// up to main which eventually calls fatal() and returns
// with a non-zero exit code.
if resp.PaymentError != "" {
return errors.New(resp.PaymentError)
}
return nil return nil
} }