{"action":"opened","issue":{"url":"https://api.github.com/repos/binarykitchen/videomail-client/issues/32","labels_url":"https://api.github.com/repos/binarykitchen/videomail-client/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/binarykitchen/videomail-client/issues/32/comments","events_url":"https://api.github.com/repos/binarykitchen/videomail-client/issues/32/events","html_url":"https://github.com/binarykitchen/videomail-client/issues/32","id":89964299,"number":32,"title":"TypeError: res is undefined","user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-21T21:36:14Z","updated_at":"2015-06-21T21:36:14Z","closed_at":null,"body":"In \r\n\r\n```js\r\n    function packError(err, res) {\r\n        if (res.body && res.body.error) {\r\n            // use the server generated text instead of the superagent's default text\r\n            err = res.body.error\r\n\r\n            if (!err.message)\r\n                err.message = res.text\r\n        }\r\n\r\n        return err\r\n    }\r\n```\r\n\r\ncheck for res is defined first.\r\n\r\n```\r\nTypeError: res is undefined\r\n\r\ncaused by useragent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\r\n\r\nhttps://videomail.io/js/main-205ea0e868.js:41229:0\r\n\r\npackError@https://videomail.io/js/main-205ea0e868.js:41229:1\r\nfetch/<@https://videomail.io/js/main-205ea0e868.js:41248:1\r\nrequire<[53]</Request.prototype.callback@https://videomail.io/js/main-205ea0e868.js:39564:3\r\nrequire<[53]</Request.prototype.timeoutError@https://videomail.io/js/main-205ea0e868.js:39589:3\r\nrequire<[53]</Request.prototype.end/xhr.onreadystatechange@https://videomail.io/js/main-205ea0e868.js:39637:1\r\nrequire<[53]</Request.prototype.abort@https://videomail.io/js/main-205ea0e868.js:39271:3\r\nrequire<[53]</Request.prototype.end/this._timer<@https://videomail.io/js/main-205ea0e868.js:39668:7\r\n```"}}