Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ibc metadata fetch error handling #396

Merged
merged 2 commits into from
Feb 14, 2024
Merged

fix: ibc metadata fetch error handling #396

merged 2 commits into from
Feb 14, 2024

Conversation

shane-moore
Copy link
Collaborator

No description provided.

@@ -50,6 +50,9 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get IBC Tokens
run: yarn --cwd packages/sdk-ui-ts get-ibc-tokens || true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the || true will make the build continue even if error occurs when running get-ibc-tokens script


const response = (await Promise.race([
ibcTokenMetadataResponse,
timeout(2000),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if response from ibc token metadata fetch takes longer than 2 seconds, the timeout function will throw an error, which will just get logged in the catch block below. then, build should continue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can pass second parameter to HttpRestClient { timeout: 2000 } and have the same logic as you implemented

@shane-moore shane-moore merged commit d9b1913 into dev Feb 14, 2024
1 check passed
@shane-moore shane-moore deleted the fix/get-ibc-tokens branch February 14, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants