Report errors from backend when a request fails (attempt 2) #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After we merged #147 it created significant conflicts with my original PR (as it touched all the exact same places my PR did). So for the benefit of the contributor we merged that one first, and I reworked this one.
If you'd like to read more about the original intentions of this PR (which are the same across the two attempts) feel free to look at #139
A major pain point for community package authors is that nearly every error on the backend is returned with
Internal Server Error
. I ensured to create as helpful of error messages as possible to try to alleviate this, until I learned that PPM itself was discarding those error messages and just returning a status code.There were already hints in the code at wanting to fix this via
request.getErrorMessage()
but it is severely under-utilized. So all this PR does is ensure we use it everywhere applicable. So that our users always are getting the best error message possible.Again for a more in-depth explanation feel free to refer to #139