You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suggest attaching request object to HTTPError. It would be useful to log request body, credentials policy etc. For now I have to use a custom http error, which leads to some problems with retry logic, so now I have to write a beforeRetry hook that checks whether request should be retried or not. It doesn't seem to do any damage to include request in HTTPError, so why not to do it? Also you could include options as well, because after normalization they could be used for logging as well
The text was updated successfully, but these errors were encountered:
I'm fine with this. Though, the hooks already receive the request and response, so in many cases it wouldn't make a difference. But it is a nice convenience to have those on the error.
@sholladay, hooks receive request, but errors aren't always handled in hooks. Maybe some particular part of an application may want to log one request that failed unexpectedly, or in React apps error may get to error boundary which wants to log it, but can't do it, because it doesn't know the details of the request, so that would be helpful
I would suggest attaching request object to
HTTPError
. It would be useful to log request body, credentials policy etc. For now I have to use a custom http error, which leads to some problems with retry logic, so now I have to write abeforeRetry
hook that checks whether request should be retried or not. It doesn't seem to do any damage to include request inHTTPError
, so why not to do it? Also you could includeoptions
as well, because after normalization they could be used for logging as wellThe text was updated successfully, but these errors were encountered: