{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/2571","repository_url":"https://api.github.com/repos/angular-ui/ui-router","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2571/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2571/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2571/events","html_url":"https://github.com/angular-ui/ui-router/issues/2571","id":135093800,"number":2571,"title":"$stateChangeError is the error parameter wrong?","user":{"login":"jpbecotte","id":4622285,"avatar_url":"https://avatars.githubusercontent.com/u/4622285?v=3","gravatar_id":"","url":"https://api.github.com/users/jpbecotte","html_url":"https://github.com/jpbecotte","followers_url":"https://api.github.com/users/jpbecotte/followers","following_url":"https://api.github.com/users/jpbecotte/following{/other_user}","gists_url":"https://api.github.com/users/jpbecotte/gists{/gist_id}","starred_url":"https://api.github.com/users/jpbecotte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpbecotte/subscriptions","organizations_url":"https://api.github.com/users/jpbecotte/orgs","repos_url":"https://api.github.com/users/jpbecotte/repos","events_url":"https://api.github.com/users/jpbecotte/events{/privacy}","received_events_url":"https://api.github.com/users/jpbecotte/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-20T16:32:26Z","updated_at":"2016-02-20T22:20:26Z","closed_at":"2016-02-20T22:20:26Z","body":"I'm trying to debug why there's an error when changing a state. So, I added:\r\n\r\n```\r\n$rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error) {\r\n  event.preventDefault();\r\n  console.log(\"An error occured: \", error);\r\n});\r\n```\r\n\r\nI was expecting an error object, but instead I got this:\r\n\r\n```\r\n{\"config\": {\"cache\": {\"destroy\": function () {\r\n          data = null;\r\n          stats = null;\r\n          lruHash = null;\r\n          delete caches[cacheId];\r\n        }, \"get\": function (key) {\r\n          if (capacity < Number.MAX_VALUE) {\r\n            var lruEntry = lruHash[key];\r\n\r\n            if (!lruEntry) return;\r\n\r\n            refresh(lruEntry);\r\n          }\r\n\r\n          return data[key];\r\n        }, \"info\": function () {\r\n          return extend({}, stats, {size: size});\r\n        }, \"put\": function (key, value) {\r\n          if (isUndefined(value)) return;\r\n          if (capacity < Number.MAX_VALUE) {\r\n            var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\r\n\r\n            refresh(lruEntry);\r\n          }\r\n\r\n          if (!(key in data)) size++;\r\n          data[key] = value;\r\n\r\n          if (size > capacity) {\r\n            this.remove(staleEnd.key);\r\n          }\r\n\r\n          return value;\r\n        }, \"remove\": function (key) {\r\n          if (capacity < Number.MAX_VALUE) {\r\n            var lruEntry = lruHash[key];\r\n\r\n            if (!lruEntry) return;\r\n\r\n            if (lruEntry == freshEnd) freshEnd = lruEntry.p;\r\n            if (lruEntry == staleEnd) staleEnd = lruEntry.n;\r\n            link(lruEntry.n,lruEntry.p);\r\n\r\n            delete lruHash[key];\r\n          }\r\n\r\n          delete data[key];\r\n          size--;\r\n        }, \"removeAll\": function () {\r\n          data = {};\r\n          size = 0;\r\n          lruHash = {};\r\n          freshEnd = staleEnd = null;\r\n        }}, \"headers\": {\"Accept\": \"text/html\"}, \"method\": \"GET\", \"paramSerializer\": function ngParamSerializer(params) {\r\n      if (!params) return '';\r\n      var parts = [];\r\n      forEachSorted(params, function(value, key) {\r\n        if (value === null || isUndefined(value)) return;\r\n        if (isArray(value)) {\r\n          forEach(value, function(v, k) {\r\n            parts.push(encodeUriQuery(key)  + '=' + encodeUriQuery(serializeValue(v)));\r\n          });\r\n        } else {\r\n          parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\r\n        }\r\n      });\r\n\r\n      return parts.join('&');\r\n    }, \"transformRequest\": [function (d) {\r\n      return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\r\n    }], \"transformResponse\": [function defaultHttpResponseTransform(data, headers) {\r\n  if (isString(data)) {\r\n    // Strip json vulnerability protection prefix and trim whitespace\r\n    var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\r\n\r\n    if (tempData) {\r\n      var contentType = headers('Content-Type');\r\n      if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {\r\n        data = fromJson(tempData);\r\n      }\r\n    }\r\n  }\r\n\r\n  return data;\r\n}], \"url\": \"templates/ScoreReview.html\"}, \"data\": null, \"headers\": function (name) {\r\n    if (!headersObj) headersObj =  parseHeaders(headers);\r\n\r\n    if (name) {\r\n      var value = headersObj[lowercase(name)];\r\n      if (value === void 0) {\r\n        value = null;\r\n      }\r\n      return value;\r\n    }\r\n\r\n    return headersObj;\r\n  }, \"status\": 0, \"statusText\": \"\"}\r\n```\r\n\r\nIs that normal? How should I debug from there?"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/comments/186691985","html_url":"https://github.com/angular-ui/ui-router/issues/2571#issuecomment-186691985","issue_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2571","id":186691985,"user":{"login":"jpbecotte","id":4622285,"avatar_url":"https://avatars.githubusercontent.com/u/4622285?v=3","gravatar_id":"","url":"https://api.github.com/users/jpbecotte","html_url":"https://github.com/jpbecotte","followers_url":"https://api.github.com/users/jpbecotte/followers","following_url":"https://api.github.com/users/jpbecotte/following{/other_user}","gists_url":"https://api.github.com/users/jpbecotte/gists{/gist_id}","starred_url":"https://api.github.com/users/jpbecotte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpbecotte/subscriptions","organizations_url":"https://api.github.com/users/jpbecotte/orgs","repos_url":"https://api.github.com/users/jpbecotte/repos","events_url":"https://api.github.com/users/jpbecotte/events{/privacy}","received_events_url":"https://api.github.com/users/jpbecotte/received_events","type":"User","site_admin":false},"created_at":"2016-02-20T22:20:26Z","updated_at":"2016-02-20T22:20:26Z","body":"I think I found the problem. There's a bug with iOS 9. I applied this [patch](http://blog.ionic.io/ios-9-potential-breaking-change/), and it worked!  "}}