Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions chaincode/src/fees/payFeeImmediatelyFromBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ export async function payFeeImmediatelyFromBalance(ctx: GalaChainContext, data:
owner: payingUser,
toBurn: [burnQuantity]
}).catch((e: ChainError) => {
throw new PaymentRequiredError(`Failed to burnTokens fee: ${e.message}`, {
paymentQuantity: quantity.toString()
});
throw new PaymentRequiredError(
`Payment Requiured. payImmediatelyFromBalance: burnTokens for payingUser: ${payingUser}, ` +
`quantity: ${quantity.toString()}, feeCode: ${feeCode}, failed with error: ${e.message}`,
{ paymentQuantity: quantity.toString() }
);
});
} else if (splitFormula instanceof ChainError) {
throw splitFormula;
Expand Down
14 changes: 9 additions & 5 deletions chaincode/src/fees/splitFeeBurnAndTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export async function splitFeeImmediatelyWithBurnAndTransfer(
toBurn: [burnQuantity]
}).catch((e) => {
throw new PaymentRequiredError(
`Failed to burnTokens for splitFeeFormula: ` +
`Payment Required. Failed to burnTokens for splitFeeFormula: ` +
`for payingUser: ${payingUser} ` +
`burnFeeQuantity: ${burnFeeQuantity.toString()}, ` +
`totalFeeQuantity: ${totalFeeQuantity.toString()}, with error: ${e.message}`,
`totalFeeQuantity: ${totalFeeQuantity.toString()}, ` +
`failed with error: ${e.message}`,
{ paymentQuantity: totalFeeQuantity.toString() }
);
});
Expand All @@ -81,10 +83,12 @@ export async function splitFeeImmediatelyWithBurnAndTransfer(
authorizedOnBehalf: undefined
}).catch((e) => {
throw new PaymentRequiredError(
`Failed to transferToken for splitFeeFormula: ` +
`Payment Required. Failed to transferToken for splitFeeFormula ` +
`defined for ${feeCode} feeCode: ` +
`from payingUser: ${payingUser}, to transferToUser: ${transfer.transferToUser}` +
`transferQuantity: ${transfer.transferQuantity.toString()} ` +
`to identity: ${transfer.transferToUser}, ` +
`totalFeeQuantity: ${totalFeeQuantity.toString()}, with error: ${e.message}`,
`totalFeeQuantity: ${totalFeeQuantity.toString()}, ` +
`Received error: ${e.message}`,
{ paymentQuantity: totalFeeQuantity.toString() }
);
});
Expand Down
Loading