{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/5217","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/5217/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/5217/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/5217/events","html_url":"https://github.com/angular/angular.js/issues/5217","id":23528177,"number":5217,"title":"$logProvider formatError suppresses sourcemapping of native console.error ","user":{"login":"richardcrichardc","id":885016,"avatar_url":"https://avatars.githubusercontent.com/u/885016?v=3","gravatar_id":"","url":"https://api.github.com/users/richardcrichardc","html_url":"https://github.com/richardcrichardc","followers_url":"https://api.github.com/users/richardcrichardc/followers","following_url":"https://api.github.com/users/richardcrichardc/following{/other_user}","gists_url":"https://api.github.com/users/richardcrichardc/gists{/gist_id}","starred_url":"https://api.github.com/users/richardcrichardc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardcrichardc/subscriptions","organizations_url":"https://api.github.com/users/richardcrichardc/orgs","repos_url":"https://api.github.com/users/richardcrichardc/repos","events_url":"https://api.github.com/users/richardcrichardc/events{/privacy}","received_events_url":"https://api.github.com/users/richardcrichardc/received_events","type":"User","site_admin":false},"labels":[{"id":69001023,"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20misc%20core","name":"component: misc core","color":"fef2c0","default":false},{"id":53079888,"url":"https://api.github.com/repos/angular/angular.js/labels/frequency:%20high","name":"frequency: high","color":"f7c6c7","default":false},{"id":69000563,"url":"https://api.github.com/repos/angular/angular.js/labels/needs:%20breaking%20change","name":"needs: breaking change","color":"e11d21","default":false},{"id":58561,"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20bug","name":"type: bug","color":"000000","default":false}],"state":"closed","locked":false,"assignee":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"assignees":[{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/61","html_url":"https://github.com/angular/angular.js/milestones/1.3.0-beta.18","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/61/labels","id":732391,"number":61,"title":"1.3.0-beta.18","description":"","creator":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":28,"state":"closed","created_at":"2014-07-25T18:06:30Z","updated_at":"2014-08-12T16:21:15Z","due_on":"2014-08-09T07:00:00Z","closed_at":"2014-08-12T16:21:15Z"},"comments":20,"created_at":"2013-11-30T23:05:58Z","updated_at":"2016-10-30T19:28:25Z","closed_at":"2014-08-03T15:32:48Z","body":"I'm developing an angular app with CoffeeScript, which is compiled to Javascript. Compilation changes line numbers which potentially makes debugging difficult, however modern browsers support sourcemapping which allow the Javascript debugger to map line numbers back to the original lines.\n\nAngular has a custom error handler with a custom function to pretty print stack traces. This custom function does not know about source maps and suppresses the native stack trace which gets the line numbers correct.\n\nE.g. an error on line 59 will be reported on line 70.\n\nThe work around is to install a custom exception handler that re throws the error. \n\n```\n.factory '$exceptionHandler', () ->\n  return (exception, cause) ->\n      console.error exception, exception.message\n      throw exception\n```\n\nMaybe there is a way to print both the native and custom stack traces. Perhaps the problem and workaround should be documented.\n\nCorrect native stack trace (Chrome):\n\n```\nUncaught ReferenceError: blah is not defined main.coffee:59\n(anonymous function) main.coffee:59\ninvoke angular.js:3647\ninstantiate angular.js:3659\n(anonymous function) angular.js:6680\n(anonymous function) angular.js:6093\nforEach angular.js:308\nnodeLinkFn angular.js:6080\ncompositeLinkFn angular.js:5546\ncompositeLinkFn angular.js:5549\ncompositeLinkFn angular.js:5549\npublicLinkFn angular.js:5454\n(anonymous function) angular.js:1300\nScope.$eval angular.js:11669\nScope.$apply angular.js:11769\n(anonymous function) angular.js:1298\ninvoke angular.js:3639\ndoBootstrap angular.js:1296\nbootstrap angular.js:1310\n(anonymous function) boot.coffee:2\n(anonymous function) app.js:85\nxhr.onreadystatechange app.js:55\n```\n\nIncorrect Angular stack trace:\n\n```\nReferenceError: blah is not defined\n    at new eval (main.coffee:70:12)\n    at invoke (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:3647:28)\n    at Object.instantiate (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:3659:23)\n    at eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:6680:28)\n    at eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:6093:34)\n    at forEach (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:308:20)\n    at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:6080:11)\n    at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:5546:15)\n    at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:5549:13)\n    at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:5549:13)\n    at publicLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:5454:30)\n    at eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:1300:27)\n    at Scope.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:11669:28)\n    at Scope.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:11769:23)\n    at eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:1298:15)\n    at Object.invoke (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:3639:25)\n    at doBootstrap (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:1296:14)\n    at Object.bootstrap (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js:1310:12)\n    at eval (boot.coffee:4:9)\n    at http://embankment.richardc.net:4000/s/app.js:85:17\n    at XMLHttpRequest.xhr.onreadystatechange (http://embankment.richardc.net:4000/s/app.js:55:9) angular.js:9194\n(anonymous function) angular.js:9194\n(anonymous function) angular.js:6747\nScope.$apply angular.js:11771\n(anonymous function) angular.js:1298\ninvoke angular.js:3639\ndoBootstrap angular.js:1296\nbootstrap angular.js:1310\n(anonymous function) boot.coffee:2\n(anonymous function) app.js:85\nxhr.onreadystatechange app.js:55\n```\n"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/257172811","html_url":"https://github.com/angular/angular.js/issues/5217#issuecomment-257172811","issue_url":"https://api.github.com/repos/angular/angular.js/issues/5217","id":257172811,"user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T19:28:25Z","updated_at":"2016-10-30T19:28:25Z","body":"AFAICT, `$exceptionHandler(exception)` does result in `console.error(exception.stack)` as long as `exception` is an instance of `Error` and has a `stack` property which contains `exception.message`. So, not sure what could be improved in Angular."}}
{"actor":{"display_login":"gkalpak"}}