We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74c99fa commit cbc6804Copy full SHA for cbc6804
lib/Client.ts
@@ -28,7 +28,8 @@ function sendRequest<T>(options: request.UriOptions) {
28
const firstErr = (data.errors && Array.isArray(data.errors) && data.errors.length !== 0) ? data.errors[0] : undefined;
29
switch (response.statusCode) {
30
case 400:
31
- reject(new Exceptions.Malformed(`${firstErr.message}: ${firstErr.field}` || "Not Found"));
+ const message = firstErr.code === "invalid_field" ? `${firstErr.message}: ${firstErr.field}` : firstErr.message;
32
+ reject(new Exceptions.Malformed(message || "Not Found"));
33
34
return;
35
case 401:
0 commit comments