-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Error message returned from the server is not shown to the user #4079
Comments
A change like this would fix the issue for me, but I am not sure how appropriate it is. |
BTW, it would be great to provide ability to override the error messages (e.g. I'd drop that "Could not post" part of the default message at all) |
Hi!
That would be a security concern. We can't blindly return any error to the client from S3, chances are we would be sending sensitive data to the client. This was a deliberate choice when making Companion. Closing this. But we can continue to discuss what you are particularly trying to inform the user about and if there are other ways of doing so. |
Hi! |
I see, I mistakenly thought your suggestion was in the server-side request. Sorry about that. @mifi I think we can do this then right? |
I'm not sure if
What do you think? |
Thank you for the considerations.
Just to clarify the issue: right now if an error occurs on the companion server side during an operation, user is presented with "Could not get/post/... " message which does not provide much help to the user even if the server if fully aware of the error details. Noting to the user for example if it makes any sense to retry the operation would improve the usability. |
Yes, I think we should ideally separate expected and unexpected errors. Expected errors should be presented to the user as i18n error messages with something actionable. Unexpected errors should just say something like "something went wrong, try again".
Yes, that's one way of doing it, by letting Uppy send the locale for example as a HTTP header to all companion requests (I believe all browsers already do that, assuming that Uppy always uses the same locale as the user's browser). Then companion needs to implement i18n. The other way of doing it (arguably cleaner) is that Companion will never send any error messages back to the Uppy client - only error codes. Then the client (which already has i18n support) will lookup the error codes and find a corresponding i18n key and display the error. If we solve it in the first way, Companion would also have to forward the locale to all providers (for example Google Drive, or your custom aws-s3-multipart server), and the servers would have to respect the locale when returning error messages. This also assumes that all those providers/servers support i18n and support all the same locales as uppy does. So I think this is the biggest argument for using error codes instead.
Yea regardless, we should definitely improve this! It's a horrible error to show the user. I'll see if I can cook up a PR |
Hi Mikael, |
I am also facing an similar issue, errors returned from server is not shown to users. |
closing in favor of #5436 |
Initial checklist
Link to runnable example
No response
Steps to reproduce
I use @uppy/aws-s3-multipart and when my custom server in response to the initial POST at companionUrl returns 400 response with JSON like
{"error":true,"message":"Session is invalid. Reload the page and start again."}
, the message is not shown to the user anywhere.Expected behavior
It would be great to include the error message from the server into the message shown to the user.
Actual behavior
Uppy dashboard, on click on (?) displays: "Upload failed / Could not post <my_server_url>" which is not very helpful.
The text was updated successfully, but these errors were encountered: