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

better error messages on server upload #549

Merged
merged 1 commit into from
May 13, 2024

Conversation

karinaas
Copy link
Contributor

Description

Sometimes asset uploads fails with error messages:

Error: Error: Server failed

Error: Error: Server was unable to write file to storage

We need some more information about status code and message from the response to debug this.

Copy link
Contributor

@leftieFriele leftieFriele left a comment

Choose a reason for hiding this comment

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

❤️ thanks for the PR 💪
For me putting the status code at the end makes it easier to read, especially since in all case except the default the status code more or less says the same as the error message.

It would give a log output like this:

Client attempted to send an invalid URL parameter, statusCode=400
Could not find server route, statusCode=404
Server failed 'file is undefined', statusCode=500

I've not done a lot of work in this module so I suggest waiting for others to chime in before changing anything in your PR 😄

Copy link
Contributor

@wkillerud wkillerud left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🙌

Adding err.message to the generic errors makes sense for sure 👍 Not sure about the status codes though (at least outside default:) since the error messages are distinct. Anyway, looks good to me ✅

@wkillerud wkillerud merged commit d5637df into eik-lib:master May 13, 2024
github-actions bot pushed a commit that referenced this pull request May 13, 2024
## [2.0.38](v2.0.37...v2.0.38) (2024-05-13)

### Bug Fixes

* include message from base error for unexpected status codes ([#549](#549)) ([d5637df](d5637df))
Copy link

🎉 This PR is included in version 2.0.38 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

3 participants