Skip to content

Commit

Permalink
fix: πŸ› crash due to unhandled promise rejection
Browse files Browse the repository at this point in the history
use `defusePromise` to prevent process crashes from unhandled promise
rejections

βœ… Closes: #1116
  • Loading branch information
polymath-eric committed Mar 8, 2024
1 parent cfaad1e commit 2926ff0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/Procedure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ProcedureAuthorization,
} from '~/types/internal';
import { signerToString } from '~/utils/conversion';
import { defusePromise } from '~/utils/internal';

/**
* @hidden
Expand Down Expand Up @@ -283,7 +284,7 @@ export class Procedure<Args = void, ReturnValue = void, Storage = Record<string,
const ctx = await this.setup(procArgs, context, opts);

// parallelize the async calls
const prepareTransactionsPromise = this.prepareTransactions(procArgs);
const prepareTransactionsPromise = defusePromise(this.prepareTransactions(procArgs));
const { roles, signerPermissions, agentPermissions, accountFrozen, noIdentity } =
await this._checkAuthorization(procArgs, ctx);

Expand Down

0 comments on commit 2926ff0

Please sign in to comment.