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(swap): Fix swap cancellation fee error handling #2784

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

@github-actions github-actions bot added the fix label Oct 16, 2023
@jorbuedo
Copy link
Contributor

Lgtm. API said that order in particular was faulty and that's why cancellation doesn't work.

460,
)
} catch (error) {
if (error instanceof Error) {
Copy link
Member

Choose a reason for hiding this comment

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

is this if required?

Copy link
Collaborator Author

@michaeljscript michaeljscript Oct 16, 2023

Choose a reason for hiding this comment

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

Yes, error is unknown in the catch and we would not be able to access error.message

Copy link
Member

Choose a reason for hiding this comment

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

in that case we need also an alert on the else side, if somewhere deep something else is thrown.

@stackchain stackchain added this to the 5.0.0 milestone Oct 16, 2023
Comment on lines 246 to 247
Alert.alert(strings.generalErrorTitle, strings.generalErrorMessage(error.message))
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Alert.alert(strings.generalErrorTitle, strings.generalErrorMessage(error.message))
}
Alert.alert(strings.generalErrorTitle, strings.generalErrorMessage(error.message))
} else {
Alert.alert(strings.generalErrorTitle, strings.generalErrorMessage(/* stringify the error - default error unknown? */))
}

Copy link
Member

Choose a reason for hiding this comment

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

smth alike

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's now updated

@stackchain stackchain merged commit 3abb343 into develop Oct 16, 2023
@stackchain stackchain deleted the fix/improve-tx-error-handling branch October 16, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants