{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/149197212","pull_request_review_id":74554569,"id":149197212,"diff_hunk":"@@ -192,6 +192,25 @@ private int RunScript(ScriptOptions options, SourceText code, ErrorLogger errorL\n                 _compiler.ReportErrors(e.Diagnostics, _console.Error, errorLogger);\n                 return CommonCompiler.Failed;\n             }\n+            catch (Exception e)\n+            {\n+                var exceptionLines = e.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None);\n+","path":"src/Scripting/Core/Hosting/CommandLine/CommandLineRunner.cs","position":7,"original_position":7,"commit_id":"ec469190e167a195fa84d7d7148e10bcc54f5369","original_commit_id":"b33f5e7d029c6bbfa5de301cadf00ace08893435","user":{"login":"adamralph","id":677704,"avatar_url":"https://avatars2.githubusercontent.com/u/677704?v=4","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"body":"Or perhaps it just needs to special case `Submission#0.<<Initialize>>`. The example above is the entry point to the script, but a lambda which is defined in the script suffers from the same problem, since it has a method name of the form `Submission#0.<<Initialize>>b__0_1()`.","created_at":"2017-11-06T20:41:59Z","updated_at":"2017-11-06T20:41:59Z","html_url":"https://github.com/dotnet/roslyn/pull/23029#discussion_r149197212","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23029","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/149197212"},"html":{"href":"https://github.com/dotnet/roslyn/pull/23029#discussion_r149197212"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23029"}},"in_reply_to_id":149181073},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/23029","id":150924112,"html_url":"https://github.com/dotnet/roslyn/pull/23029","diff_url":"https://github.com/dotnet/roslyn/pull/23029.diff","patch_url":"https://github.com/dotnet/roslyn/pull/23029.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/23029","number":23029,"state":"open","locked":false,"title":"csi: print the submission stack trace only to the console","user":{"login":"adamralph","id":677704,"avatar_url":"https://avatars2.githubusercontent.com/u/677704?v=4","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"body":"If a script contains just `throw new Exception(\"hello world\");` then csi outputs this to the console:\r\n\r\n```\r\nSystem.Exception: hello world\r\n   at Submission#0.<<Initialize>>d__0.MoveNext() in c:\\code\\foo.csx:line 1\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()\r\n   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()\r\n   at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunScript(ScriptOptions options, SourceText code, ErrorLogger errorLogger, CancellationToken cancellationToken)\r\n   at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunInteractiveCore(ErrorLogger errorLogger)\r\n   at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunInteractive()\r\n   at Microsoft.CodeAnalysis.CSharp.Scripting.Hosting.Csi.Main(String[] args) in C:\\code\\dotnet\\roslyn\\src\\Interactive\\csi\\Csi.cs:line 40\r\n```\r\n\r\nThe only useful part of this is:\r\n\r\n```\r\nSystem.Exception: hello world\r\n   at Submission#0.<<Initialize>>d__0.MoveNext() in c:\\code\\foo.csx:line 1\r\n```","created_at":"2017-11-06T18:21:44Z","updated_at":"2017-11-06T20:41:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7892c4e1790417bde451bd27e434af6edacf20d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23029/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23029/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/23029/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/ec469190e167a195fa84d7d7148e10bcc54f5369","head":{"label":"adamralph:submission-stack-trace-only","ref":"submission-stack-trace-only","sha":"ec469190e167a195fa84d7d7148e10bcc54f5369","user":{"login":"adamralph","id":677704,"avatar_url":"https://avatars2.githubusercontent.com/u/677704?v=4","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"repo":{"id":29309584,"name":"roslyn","full_name":"adamralph/roslyn","owner":{"login":"adamralph","id":677704,"avatar_url":"https://avatars2.githubusercontent.com/u/677704?v=4","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamralph/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/adamralph/roslyn","forks_url":"https://api.github.com/repos/adamralph/roslyn/forks","keys_url":"https://api.github.com/repos/adamralph/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamralph/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamralph/roslyn/teams","hooks_url":"https://api.github.com/repos/adamralph/roslyn/hooks","issue_events_url":"https://api.github.com/repos/adamralph/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/adamralph/roslyn/events","assignees_url":"https://api.github.com/repos/adamralph/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/adamralph/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/adamralph/roslyn/tags","blobs_url":"https://api.github.com/repos/adamralph/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamralph/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamralph/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamralph/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamralph/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/adamralph/roslyn/languages","stargazers_url":"https://api.github.com/repos/adamralph/roslyn/stargazers","contributors_url":"https://api.github.com/repos/adamralph/roslyn/contributors","subscribers_url":"https://api.github.com/repos/adamralph/roslyn/subscribers","subscription_url":"https://api.github.com/repos/adamralph/roslyn/subscription","commits_url":"https://api.github.com/repos/adamralph/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamralph/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamralph/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamralph/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamralph/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/adamralph/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamralph/roslyn/merges","archive_url":"https://api.github.com/repos/adamralph/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamralph/roslyn/downloads","issues_url":"https://api.github.com/repos/adamralph/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/adamralph/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/adamralph/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/adamralph/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamralph/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/adamralph/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/adamralph/roslyn/deployments","created_at":"2015-01-15T17:42:01Z","updated_at":"2016-04-24T18:49:56Z","pushed_at":"2017-11-06T19:57:20Z","git_url":"git://github.com/adamralph/roslyn.git","ssh_url":"git@github.com:adamralph/roslyn.git","clone_url":"https://github.com/adamralph/roslyn.git","svn_url":"https://github.com/adamralph/roslyn","homepage":"","size":242288,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"72b8f88b0daf42e1a8b1d6687cbfc9ccbb0cc21a","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2017-11-06T17:41:23Z","pushed_at":"2017-11-06T20:13:58Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":252516,"stargazers_count":8353,"watchers_count":8353,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2034,"mirror_url":null,"archived":false,"open_issues_count":4080,"forks":2034,"open_issues":4080,"watchers":8353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23029"},"html":{"href":"https://github.com/dotnet/roslyn/pull/23029"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/23029"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/23029/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23029/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23029/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/ec469190e167a195fa84d7d7148e10bcc54f5369"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adamralph"}}