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

don't throw in token bridge lookup #566

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Conversation

artursapek
Copy link
Collaborator

prevents a throw that happens here from crashing routes

really this should return something like a Result with either Some(token) or None instead of throwing... but this will do for now :-)

try {
return [await TokenTransfer.lookupDestinationToken(fromChain, toChain, sourceToken)];
} catch (e) {
console.error(`Failed to get destination token: ${e}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont love the console.errors, but we need a general strat around what/when/where we console.error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

better would be to not even throw here and just return something akin to a Result (Some(token) | None)

@barnjamin barnjamin merged commit 30b3787 into main Jun 7, 2024
1 check passed
@barnjamin barnjamin deleted the dont-throw-token-bridge branch June 7, 2024 12:01
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