Skip to content

Commit

Permalink
feat: Remove try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Halibao-Lala committed Jan 3, 2025
1 parent 6e3ae7e commit 956fcbf
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions apps/canonical-bridge-server/src/shared/web3/web3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,41 @@ export class Web3Service {
}

async getTransferConfigsForAll() {
try {
const { data } = await this.httpService.axiosRef.get<ITransferConfigsForAll>(
`${CBRIDGE_ENDPOINT}/v2/getTransferConfigsForAll`,
);
return data;
} catch (e) {
console.error(`Failed to retrieve cBridge data at ${new Date().getTime()}`, e.message);
}
// try {
const { data } = await this.httpService.axiosRef.get<ITransferConfigsForAll>(
`${CBRIDGE_ENDPOINT}/v2/getTransferConfigsForAll`,
);
return data;
// } catch (e) {
// console.error(`Failed to retrieve cBridge data at ${new Date().getTime()}`, e.message);
// }
}

async getDebridgeChains() {
try {
const { data } = await this.httpService.axiosRef.get<{ chains: IDebridgeChain[] }>(
`${DEBRIDGE_ENDPOINT}/supported-chains-info`,
);
// try {
const { data } = await this.httpService.axiosRef.get<{ chains: IDebridgeChain[] }>(
`${DEBRIDGE_ENDPOINT}/supported-chains-info`,
);

return data;
} catch (e) {
console.error(`Failed to retrieve DeBridge chain data at ${new Date().getTime()}`, e.message);
}
return data;
// } catch (e) {
// console.error(`Failed to retrieve DeBridge chain data at ${new Date().getTime()}`, e.message);
// }
}

async getDebridgeChainTokens(chainId: number) {
try {
const { data } = await this.httpService.axiosRef.get<{
tokens: Record<string, IDebridgeToken>;
}>(`${DEBRIDGE_ENDPOINT}/token-list?chainId=${chainId}`);
// try {
const { data } = await this.httpService.axiosRef.get<{
tokens: Record<string, IDebridgeToken>;
}>(`${DEBRIDGE_ENDPOINT}/token-list?chainId=${chainId}`);

return data;
} catch (e) {
console.error(
`Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()}`,
e.message,
);
}
return data;
// } catch (e) {
// console.error(
// `Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()}`,
// e.message,
// );
// }
}

async getStargateConfigs() {
Expand Down

0 comments on commit 956fcbf

Please sign in to comment.