mws-advanced icon indicating copy to clipboard operation
mws-advanced copied to clipboard

callEndpoint saveRaw and saveParsed options are never hit if the server errors

Open ericblade opened this issue 7 years ago • 1 comments

I would sort of expect that they would probably both hit, saving the error data to the file. There's some inconsistency here, particularly when dealing with parseEndpoint vs callEndpoint -- tests from getMatchingProductForId expose that parseEndpoint is not currently as robust at dealing with errors as it should? be? and that there is some inconsistency in how errors are dealt with -- so far, I've only dealt with errors in functions where I've actually received them, rather than make an attempt to deal with the Known Unknowns and the Unknown Unknowns. :-D

The inconsistency is that errors that bypass saveRaw and saveParsed would also not be parseable by any of the data parsers that i'm currently creating.

SO, we need to take the mostly re-architected getMatchingProductForId, which has easily repeatable error conditions, and make sure that we clean up the error handling, so that we know exactly what to expect whenever an API call throws an error, whether we are using callEndpoint or parseEndpoint.

ericblade avatar May 14 '18 02:05 ericblade

fwiw, mws-simple also does not log in error cases. that may be the root of the problem.

ericblade avatar Sep 27 '18 01:09 ericblade