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
nock('https://test.cn:443',{"encodedQueryParams":true}).post('/user',{"name":"景全安"}).reply(400,{"code":400,"format":"json","message":"{\"error\": \"Parameter \\\"email\\\" was missing from the request\"}"});
I would expect that the error thrown in client.js would include the original response object so that it can be handled correctly. But the error that is thrown only includes the code and headers. For example, when logged the error displays as:
Error: POST https://test.cn failed width code(400).
Please note that the message, "Parameter email was missing from the request" does not exist in the error.
This makes it difficult to use this client with APIs that return errors that are not in the header, for example, because of input validation.
The text was updated successfully, but these errors were encountered:
Given a request and response like the one below:
I would expect that the error thrown in
client.js
would include the original response object so that it can be handled correctly. But the error that is thrown only includes thecode
andheaders
. For example, when logged the error displays as:Please note that the message, "Parameter email was missing from the request" does not exist in the error.
This makes it difficult to use this client with APIs that return errors that are not in the header, for example, because of input validation.
The text was updated successfully, but these errors were encountered: