Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/integration/blockchain/polygon/polygon-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class PolygonClient extends EvmClient implements L2BridgeEvmClient {
const { polygonWalletAddress } = GetConfig().blockchain.polygon;

this.posClient = new POSClient();
void this.initPolygonNetwork(ethWalletAddress, polygonWalletAddress);
this.initPolygonNetwork(ethWalletAddress, polygonWalletAddress).catch((e) =>
this.logger.error('Polygon network initialization failed:', e),
);

this.l2TxIdCache = new Set();
}
Expand Down
8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ process.on('uncaughtException', (error) => {
process.exit(1);
});

process.on('unhandledRejection', (reason) => {
const logger = new DfxLogger('UnhandledRejection');
logger.error(
'Unhandled promise rejection (process kept alive):',
reason instanceof Error ? reason : new Error(String(reason)),
);
});

async function bootstrap() {
if (process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
AppInsights.setup().setAutoDependencyCorrelation(true).setAutoCollectConsole(true, true);
Expand Down
Loading