htlcswitch: replace outgoing failure with interface

Add a FailureDetail interface which allows us have different kinds of
failures for link errors. This interface will be used to cover failures
that occur when on invoice payment, because the errors have already
been enumerated in the invoices package.
This commit is contained in:
carla committed 2020-02-06 19:43:23 +02:00
1 parent bdd9411bbd
commit 9390d3bbfd
3 files changed
+23 -12

No files matched your search

+4 -3
View File
@@ -923,8 +923,8 @@ func (s *Switch) parseFailedPayment(deobfuscator ErrorDecrypter,
)
log.Errorf("%v: (hash=%v, pid=%d): %v",
linkError.OutgoingFailure, paymentHash, paymentID,
err)
linkError.FailureDetail.FailureString(),
paymentHash, paymentID, err)
return linkError
}
@@ -942,7 +942,8 @@ func (s *Switch) parseFailedPayment(deobfuscator ErrorDecrypter,
OutgoingFailureOnChainTimeout,
)
log.Info("%v: hash=%v, pid=%d", linkError.OutgoingFailure,
log.Info("%v: hash=%v, pid=%d",
linkError.FailureDetail.FailureString(),
paymentHash, paymentID)
return linkError