Merge pull request #2651 from kaplanmaxe/payinvoice-error-exit-code

lncli: returning non 0 exit code when paying invoice fails
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-02-20 15:07:32 -08:00
commit 8a0d0ec98f
1 file changed
+7
+7
View File
@@ -2176,6 +2176,13 @@ func sendPaymentRequest(client lnrpc.LightningClient, req *lnrpc.SendRequest) er
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
}