{"action":"opened","issue":{"url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/424","labels_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/424/comments","events_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/424/events","html_url":"https://github.com/google/google-api-nodejs-client/issues/424","id":74830965,"number":424,"title":"[2.x regression] Error code no longer passed through in response","user":{"login":"bradvogel","id":821706,"avatar_url":"https://avatars.githubusercontent.com/u/821706?v=3","gravatar_id":"","url":"https://api.github.com/users/bradvogel","html_url":"https://github.com/bradvogel","followers_url":"https://api.github.com/users/bradvogel/followers","following_url":"https://api.github.com/users/bradvogel/following{/other_user}","gists_url":"https://api.github.com/users/bradvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/bradvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradvogel/subscriptions","organizations_url":"https://api.github.com/users/bradvogel/orgs","repos_url":"https://api.github.com/users/bradvogel/repos","events_url":"https://api.github.com/users/bradvogel/events{/privacy}","received_events_url":"https://api.github.com/users/bradvogel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-10T04:40:37Z","updated_at":"2015-05-10T04:40:37Z","closed_at":null,"body":"I'm using v2.0.3 of this library in the following way:\r\n\r\n```\r\n      client.users.drafts.update({\r\n        userId: 'me',\r\n        id: gmailDraftId,\r\n        resource: {\r\n          message: {\r\n            raw: require('base64-url').encode(job.data.emailDraft)\r\n          }\r\n        }\r\n      }, function(err, res, req) {\r\n          // Detect 404 errors\r\n         if (err.code === 404) console.log('does not exist');\r\n      }));\r\n```\r\n\r\nIn v1.x of this library, `err.code` was populated and correctly set to `404` when the draft didn't exist. However, since I upgraded to 2.x, `err.code` is now undefined. However, the response from the api hasn't changed; `req.body` is still: ` { error: { errors: [Object], code: 404, message: 'Not Found' } } }`.\r\n\r\nDid something break in 2.x causing the error code to not get passed through from the response?"}}