-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Why eat the possible errors in the upload ? #66
Comments
This is indeed an oversight. PRs welcome. |
@TimMikeladze Actually for my use case, I think it's better to use a server action like the following:
With this server action, I can do the existence verification before uploading files in the client, avoiding upload requests for already existent files:
This not only ensures error prevention but also idempotence. So, I'm retreating on my PR suggestion for now. But how do you think it should be done ? My idea was just adding a |
Hello,
In the file
src/react/useNextUpload.tsx
, in theupload
function returned by the hookuseNextUpload
, why does it eat the possible errors ? Is it for security reasons, to not let confidential information leaking to the client ? Then, why not throw a generic error instead ?In my use case, I'm finding myself with some failed upload requests (due to external reasons) and since the errors are eaten, the app continues the flow and I end up with corrupted orders in my database, which can result in a bad deliver for my clients.
If it's indeed a bug, I can propose a PR. If it's not, let me know your reasons, please.
Thanks
The text was updated successfully, but these errors were encountered: