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:
3 files changed
+23
-12
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user