Clean up error logging.

This commit is contained in:
Kevin Gorham 2021-05-25 16:02:27 -04:00
parent 84ca57f432
commit 467282d385
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
2 changed files with 7 additions and 5 deletions

View File

@ -124,7 +124,8 @@ class PersistentTransactionManager(
updateEncoding(tx.id, encodedTx.raw, encodedTx.txId, encodedTx.expiryHeight)
}
} catch (t: Throwable) {
val message = "failed to encode transaction due to : ${t.message} caused by: ${t.cause}"
var message = "failed to encode transaction due to : ${t.message}"
t.cause?.let { message += " caused by: $it" }
twig(message)
safeUpdate("updating transaction error info") {
updateError(tx.id, message, ERROR_ENCODING)
@ -158,7 +159,8 @@ class PersistentTransactionManager(
updateEncoding(tx.id, encodedTx.raw, encodedTx.txId, encodedTx.expiryHeight)
}
} catch (t: Throwable) {
val message = "failed to encode shielding transaction due to : ${t.message} caused by: ${t.cause}"
var message = "failed to encode auto-shielding transaction due to : ${t.message}"
t.cause?.let { message += " caused by: $it" }
twig(message)
safeUpdate("updating shielding transaction error info") {
updateError(tx.id, message, ERROR_ENCODING)
@ -203,8 +205,9 @@ class PersistentTransactionManager(
}
} catch (t: Throwable) {
// a non-server error has occurred
val message =
"Unknown error while submitting transaction: ${t.message} caused by: ${t.cause}"
var message =
"Unknown error while submitting transaction: ${t.message}"
t.cause?.let { message += " caused by: $it" }
twig(message)
safeUpdate("updating submission failure") {
updateError(tx.id, t.message, ERROR_SUBMITTING)

View File

@ -55,7 +55,6 @@ class WalletTransactionEncoder(
transparentSecretKey: String,
memo: ByteArray?
): EncodedTransaction = withContext(IO) {
twig("TMP: createShieldingTransaction with $spendingKey and $transparentSecretKey and ${memo?.size}")
val transactionId = createShieldingSpend(spendingKey, transparentSecretKey, memo)
repository.findEncodedTransactionById(transactionId)
?: throw TransactionEncoderException.TransactionNotFoundException(transactionId)