{"action":"created","issue":{"url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/22","labels_url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/22/comments","events_url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/22/events","html_url":"https://github.com/angular-resource-sails/angular-resource-sails/issues/22","id":92313523,"number":22,"title":"Cannot read property 'error'","user":{"login":"stvogel","id":4895281,"avatar_url":"https://avatars.githubusercontent.com/u/4895281?v=3","gravatar_id":"","url":"https://api.github.com/users/stvogel","html_url":"https://github.com/stvogel","followers_url":"https://api.github.com/users/stvogel/followers","following_url":"https://api.github.com/users/stvogel/following{/other_user}","gists_url":"https://api.github.com/users/stvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/stvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stvogel/subscriptions","organizations_url":"https://api.github.com/users/stvogel/orgs","repos_url":"https://api.github.com/users/stvogel/repos","events_url":"https://api.github.com/users/stvogel/events{/privacy}","received_events_url":"https://api.github.com/users/stvogel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-01T08:27:16Z","updated_at":"2015-07-01T13:33:19Z","closed_at":null,"body":"Hi there,\r\n\r\nthanks a lot for this really neat piece of software.\r\n\r\nI just stumbled over this error:\r\n\r\n    TypeError: Cannot read property 'error' of undefined at sailsResource.js:212\r\n\r\nWhich is (in function `handleResponse(item, data, action, deferred, delegate)`):\r\n\r\n    if (data.error || data.statusCode > 400 || isString(data)) {\r\n\r\nI just changed that to:\r\n\r\n    if (data && (data.error || data.statusCode > 400 || isString(data))) {\r\n\r\nI'm not that deep into this module. I hope this is the correct solution.\r\n\t\t\t\t\t"},"comment":{"url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/comments/117677922","html_url":"https://github.com/angular-resource-sails/angular-resource-sails/issues/22#issuecomment-117677922","issue_url":"https://api.github.com/repos/angular-resource-sails/angular-resource-sails/issues/22","id":117677922,"user":{"login":"JasonMore","id":383719,"avatar_url":"https://avatars.githubusercontent.com/u/383719?v=3","gravatar_id":"","url":"https://api.github.com/users/JasonMore","html_url":"https://github.com/JasonMore","followers_url":"https://api.github.com/users/JasonMore/followers","following_url":"https://api.github.com/users/JasonMore/following{/other_user}","gists_url":"https://api.github.com/users/JasonMore/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonMore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonMore/subscriptions","organizations_url":"https://api.github.com/users/JasonMore/orgs","repos_url":"https://api.github.com/users/JasonMore/repos","events_url":"https://api.github.com/users/JasonMore/events{/privacy}","received_events_url":"https://api.github.com/users/JasonMore/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T13:33:19Z","updated_at":"2015-07-01T13:33:19Z","body":"@stvogel thanks. The response api changed a bit between sails versions and I don't think all the edge cases were discovered. There is a PR I need to review today which has the same fix so expect a version bump soon.\r\n\r\nhttps://github.com/angular-resource-sails/angular-resource-sails/pull/21\r\n"}}