-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
cached *APIError | ||
cachedErr error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decode the re.Response.Body
on .Error()
. I didn't feel like trying to fix that behavior, but I need to cache the decoded payload as .Error() can be called more than once, and then the second one fails. So I split .Error()
in to .Payload
so I can extract the payload and not change any current behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice catch, I also think we had this buggy code duplicated in the monorepo. merged a patch there last week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still feels a little odd, but I didn't want to refactor how errors worked as I only touched small areas of the cli so far.
So this works for now.
I'll merge when the |
I broke some test making the errors better... I'll look into it :/ |
ddb9bae
to
fe5a60c
Compare
I realized this can be merged first, as I handle verbose errors better here too. So it works better against all release of |
Related to: https://github.com/cdr/m/pull/7373
In addition to the errors reported in the
/m
pr, this also now expands verbose errors. These verbose errors are not yet reviewed for human readability:404 Repo
Empty Request
Any server internal error