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
Axios library returns err.response, err.request and err.config, which are very fat and make stdout impossible to read. Need to figure out if we have to return some of these values to the user or not. And if so, we have to define the output + design.
One thing I've run into which trolled me hard for a while was .response being deleted from the error thrown by makeRequest.
I was throwing custom errors from our overridden makeRequest function and was attaching the request as I needed conditional logic based on the response status code. Spent ages trying to work out why my response object wasn't available on the error without thinking to check that this package could be modifying errors rather than simply passing them through (I didn't actually get that far, I ended up renaming .request to .res assuming it was some weird zapier-cli quirk 🙈).
Does it make more sense to pass errors through as-is in this library and leave it up to the consumer's error handling/logging to do what it needs to do?
Does it make more sense to pass errors through as-is in this library and leave it up to the consumer's error handling/logging to do what it needs to do?
I think this is the best thing to do - and lines up with exposing primitives task
Activity
[admin-api] Reduced library error fields for now
kevinansfield commentedon Mar 22, 2019
One thing I've run into which trolled me hard for a while was
.responsebeing deleted from the error thrown bymakeRequest.I was throwing custom errors from our overridden
makeRequestfunction and was attaching the request as I needed conditional logic based on the response status code. Spent ages trying to work out why my response object wasn't available on the error without thinking to check that this package could be modifying errors rather than simply passing them through (I didn't actually get that far, I ended up renaming.requestto.resassuming it was some weird zapier-cli quirk 🙈).Does it make more sense to pass errors through as-is in this library and leave it up to the consumer's error handling/logging to do what it needs to do?
allouis commentedon Jul 5, 2019
I think this is the best thing to do - and lines up with exposing primitives task
[admin-api] Reduced library error fields for now
[admin-api] Reduced library error fields for now
[admin-api] Reduced library error fields for now