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

Handle errors in updateTranslation #146

Open
WULCAN opened this issue Dec 7, 2024 · 1 comment · May be fixed by #152
Open

Handle errors in updateTranslation #146

WULCAN opened this issue Dec 7, 2024 · 1 comment · May be fixed by #152
Labels
🦐 small webapp Related to the Lyra web app

Comments

@WULCAN
Copy link
Collaborator

WULCAN commented Dec 7, 2024

Description

The server action updateTranslation returns an explicit object for some errors but throws a MessageNotFound if the request is for an unrecognized message.

I don't know exactly what happens with thrown errors from server actions but if we chose explicit error-representing objects for the other cases, I suspect our client will not handle this thrown error very well.

  1. Understand and describe how thrown errors are handled in server actions.
  2. Review how that affects our use of updateTranslation
  3. Potentially update our error handling in updateTranslation

Estimated size (S, M, L)

I think this issue is Small because the problem is local and contained.

Possible implementations

One possibility is to return an explicit error-representing object instead. Our client-side code probably handles those.

Open questions

  1. In what cases can this error state actually happen?
  2. What is the ideal error handling for those cases?
@WULCAN WULCAN added webapp Related to the Lyra web app 🦐 small labels Dec 7, 2024
@WULCAN WULCAN mentioned this issue Dec 7, 2024
@owenboy9 owenboy9 linked a pull request Jan 19, 2025 that will close this issue
@WULCAN
Copy link
Collaborator Author

WULCAN commented Jan 25, 2025

@owenboy9 tested the consequences of this by changing the if statement to if (true) to always trigger the error case. That revealed a consequence of throwing in this action to be that the save button keeps animating and never resolves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦐 small webapp Related to the Lyra web app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant