Skip to content

Commit

Permalink
chore: add transaction error reason
Browse files Browse the repository at this point in the history
  • Loading branch information
luisburigo committed Oct 17, 2024
1 parent ae21f24 commit 07f1e86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/api/src/modules/transaction/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class TransactionService implements ITransactionService {

return await this.update(id, _api_transaction);
} catch (e) {
console.log('Error on sendToChain', e);
const error = 'toObject' in e ? e.toObject() : e;
const _api_transaction: IUpdateTransactionPayload = {
status: TransactionStatus.FAILED,
sendTime: new Date(),
Expand All @@ -555,6 +555,7 @@ export class TransactionService implements ITransactionService {
...resume,
gasUsed: '0.0',
status: TransactionStatus.FAILED,
error,
},
};
return await this.update(id, _api_transaction);
Expand Down

0 comments on commit 07f1e86

Please sign in to comment.