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

Wrap in a transaction operations a respondents list #2376

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

ismaelbej
Copy link
Contributor

Changes

  • Wrap creation, adding and updating a respondent group
  • Detect errors when the endpoint returns a 500 error

@ismaelbej ismaelbej marked this pull request as ready for review December 4, 2024 21:17
Copy link
Member

@matiasgarciaisaia matiasgarciaisaia left a comment

Choose a reason for hiding this comment

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

👍 :shipit:

},
() => {
// Reject with original error
Promise.reject(e)
Copy link
Member

Choose a reason for hiding this comment

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

The error we get doing this is JSON.parse: unexpected character at line 1 column 1 of the JSON data, which isn't really useful for the user. Without this block, we get an equally useless Unhandled promise rejection error.

I'd keep this, anyways, so we're closer to something useful. We should eventually change the endpoint to reply a JSON error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my tests the JSON error didn't bubble up high enough, it logged on the browser console but no feedback to the user. The outer error did show the popup with not much information. It could have been replaced by new Error("some message"), still not very friendly.

@matiasgarciaisaia matiasgarciaisaia merged commit 1499d7d into main Dec 6, 2024
2 checks passed
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