Skip to content

Commit 74c99fa

Browse files
committed
Added field value to thrown 400 errors for better debugging
1 parent 7eecb81 commit 74c99fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function sendRequest<T>(options: request.UriOptions) {
2828
const firstErr = (data.errors && Array.isArray(data.errors) && data.errors.length !== 0) ? data.errors[0] : undefined;
2929
switch (response.statusCode) {
3030
case 400:
31-
reject(new Exceptions.Malformed(firstErr.message || "Not Found"));
31+
reject(new Exceptions.Malformed(`${firstErr.message}: ${firstErr.field}` || "Not Found"));
3232

3333
return;
3434
case 401:

0 commit comments

Comments
 (0)