{"action":"created","issue":{"url":"https://api.github.com/repos/frhagn/Typewriter/issues/105","repository_url":"https://api.github.com/repos/frhagn/Typewriter","labels_url":"https://api.github.com/repos/frhagn/Typewriter/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/frhagn/Typewriter/issues/105/comments","events_url":"https://api.github.com/repos/frhagn/Typewriter/issues/105/events","html_url":"https://github.com/frhagn/Typewriter/pull/105","id":143215241,"number":105,"title":"Feature: log thrown exception","user":{"login":"SeriousM","id":462013,"avatar_url":"https://avatars.githubusercontent.com/u/462013?v=3","gravatar_id":"","url":"https://api.github.com/users/SeriousM","html_url":"https://github.com/SeriousM","followers_url":"https://api.github.com/users/SeriousM/followers","following_url":"https://api.github.com/users/SeriousM/following{/other_user}","gists_url":"https://api.github.com/users/SeriousM/gists{/gist_id}","starred_url":"https://api.github.com/users/SeriousM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeriousM/subscriptions","organizations_url":"https://api.github.com/users/SeriousM/orgs","repos_url":"https://api.github.com/users/SeriousM/repos","events_url":"https://api.github.com/users/SeriousM/events{/privacy}","received_events_url":"https://api.github.com/users/SeriousM/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-24T10:52:27Z","updated_at":"2016-04-01T07:51:37Z","closed_at":"2016-03-30T13:58:13Z","pull_request":{"url":"https://api.github.com/repos/frhagn/Typewriter/pulls/105","html_url":"https://github.com/frhagn/Typewriter/pull/105","diff_url":"https://github.com/frhagn/Typewriter/pull/105.diff","patch_url":"https://github.com/frhagn/Typewriter/pull/105.patch"},"body":"It's pretty hard to get a clue where in your template an exception was thrown.\r\nThe usual way is to test/disable each and every custom method and wait if you got the error.\r\nOr you wrap your output of a method (only if it's a string) with a try/catch and return the exception's message.\r\n\r\nThis is pretty cumbersome.\r\n\r\nI enhanced the logging of the errors in the Parser to log the exception as a whole.\r\n\r\nComparision:\r\n\r\nOLD:\r\n```\r\nERROR: Error rendering template. Cannot get identifier 'getTypeName'. Exception has been thrown by the target of an invocation. Source path: C:\\Project\\SomeFile.cs\r\n```\r\n\r\nNEW:\r\n```\r\nERROR: Error rendering template. Cannot get identifier 'getTypeName'. Exception has been thrown by the target of an invocation. Source path: C:\\Project\\SomeFile.cs\r\nSystem.InvalidOperationException: Oh oh, something happend here. where is the callstack? ---> System.Exception: Inner exception text for demonstration\r\n   --- End of inner exception stack trace ---\r\n   at __Typewriter.Template.getInterfaceName(String name)\r\n   at __Typewriter.Template.getTypeName(Class c)\r\n```\r\nNotice the callstack which really points me the way where the exception was thrown.\r\n`getInterfaceName` and `getTypeName` do exist in my template.\r\n\r\nI hope you will accept the PR because it makes it so much easier to find errors.\r\n\r\nThe modification of the logging only changes the behavior of the Output window, not the errors in the visual studio error list for now.\r\n\r\nShould the same error be shown in the error list as well?"},"comment":{"url":"https://api.github.com/repos/frhagn/Typewriter/issues/comments/204298023","html_url":"https://github.com/frhagn/Typewriter/pull/105#issuecomment-204298023","issue_url":"https://api.github.com/repos/frhagn/Typewriter/issues/105","id":204298023,"user":{"login":"SeriousM","id":462013,"avatar_url":"https://avatars.githubusercontent.com/u/462013?v=3","gravatar_id":"","url":"https://api.github.com/users/SeriousM","html_url":"https://github.com/SeriousM","followers_url":"https://api.github.com/users/SeriousM/followers","following_url":"https://api.github.com/users/SeriousM/following{/other_user}","gists_url":"https://api.github.com/users/SeriousM/gists{/gist_id}","starred_url":"https://api.github.com/users/SeriousM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeriousM/subscriptions","organizations_url":"https://api.github.com/users/SeriousM/orgs","repos_url":"https://api.github.com/users/SeriousM/repos","events_url":"https://api.github.com/users/SeriousM/events{/privacy}","received_events_url":"https://api.github.com/users/SeriousM/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T07:51:37Z","updated_at":"2016-04-01T07:51:37Z","body":"may I ask for the next release? I guess after this one I'm done more or less."}}