Title: Some concerns about error formatting with ErrorView = ConciseView · Issue #10877 · PowerShell/PowerShell · GitHub
Open Graph Title: Some concerns about error formatting with ErrorView = ConciseView · Issue #10877 · PowerShell/PowerShell
X Title: Some concerns about error formatting with ErrorView = ConciseView · Issue #10877 · PowerShell/PowerShell
Description: #10641 - The new error formatting is nice but it might have some disadvantages, too. Demo script function Test-Error { Write-Error @' Oops, error! Details: - Somewhat long details line 1, and more somewhat long details line 1. - Somewhat...
Open Graph Description: #10641 - The new error formatting is nice but it might have some disadvantages, too. Demo script function Test-Error { Write-Error @' Oops, error! Details: - Somewhat long details line 1, and more ...
X Description: #10641 - The new error formatting is nice but it might have some disadvantages, too. Demo script function Test-Error { Write-Error @' Oops, error! Details: - Somewhat long details line 1, and m...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10877
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Some concerns about error formatting with ErrorView = ConciseView","articleBody":"https://github.com/PowerShell/PowerShell/pull/10641 - The new error formatting is nice but it might have some disadvantages, too.\r\n\r\n**Demo script**\r\n\r\n```powershell\r\nfunction Test-Error {\r\n Write-Error @'\r\nOops, error! Details:\r\n- Somewhat long details line 1, and more somewhat long details line 1.\r\n- Somewhat long details line 2, and more somewhat long details line 2.\r\n'@\r\n}\r\n\r\nTest-Error\r\n```\r\n\r\n**NormalView error formatting** (good old but with some \"noise\"):\r\n\r\n```\r\nTest-Error : Oops, error! Details:\r\n- Somewhat long details line 1, and more somewhat long details line 1.\r\n- Somewhat long details line 2, and more somewhat long details line 2.\r\nAt C:\\ROM\\z\\_191023_233922_ps_ErrorView\\bad-error.ps1:11 char:1\r\n+ Test-Error\r\n+ ~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException\r\n + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-Error\r\n```\r\n\r\n**ConciseView error formatting** (nice and shiny but with issues):\r\n\r\n```\r\nTest-Error: C:\\ROM\\z\\_191023_233922_ps_ErrorView\\bad-error.ps1\r\nLine |\r\n 11 | Test-Error\r\n | ^ Oops, error! Details: - Somewhat long details line 1, and more somewhat long details line 1. - Somewhat long details line 2, and more somewhat long\r\n | details line 2.\r\n```\r\n\r\n**Some issues**\r\n\r\n1. The file path and line number are in different places. Even for a human it requires\r\n some effort to connect them together in order to go to the problem location.\r\n But it is also the challenge for various error parsers in text editors, log\r\n parsers, etc. VSCode, for example, understands \"standard link\" patterns as\r\n `\u003cpath>(\u003cline>)`, `\u003cpath>:\u003cline> [char:\u003ccolumn>]`. Is it going to work well\r\n with the new ConciseView formatting?\r\n1. Column number is missing. The caret position is shown in a different way,\r\n this is somewhat fine for humans but programs (VSCode and others) will\r\n have difficulties with getting this info.\r\n1. Line formatting of error messages is not respected. Yes, in most cases error\r\n messages are one liners. But lengthy errors with some detailed multiline\r\n descriptions are not rare, too. Preserving the original formatting of such\r\n messages would be useful, they were composed in such a way for reasons.\r\n1. When the error caret position is more to the right, the error message first\r\n line is more indented and gets even more difficult to read for long messages.\r\n Copying the error messages is also difficult with such extra indentation.\r\n\r\n**Suggestion**\r\n\r\nFor ConciseView, why not just strip some \"noise\", i.e. CategoryInfo and\r\nFullyQualifiedErrorId lines and keep the rest just like in NormalView?\r\nExample:\r\n\r\n```\r\nTest-Error : Oops, error! Details:\r\n- Somewhat long details line 1, and more somewhat long details line 1.\r\n- Somewhat long details line 2, and more somewhat long details line 2.\r\nAt C:\\ROM\\z\\_191023_233922_ps_ErrorView\\bad-error.ps1:11 char:1\r\n+ Test-Error\r\n+ ~~~~~~~~~~\r\n```\r\n\r\nAll the above issues are resolved (or at least negative effects reduced).\r\n","author":{"url":"https://github.com/nightroman","@type":"Person","name":"nightroman"},"datePublished":"2019-10-24T02:26:41Z","url":"https://github.com/PowerShell/PowerShell/issues/10877"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a109611a-6f5a-d85d-3d8a-9f56413ac6a2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D36A:180C65:69A2A:8EDE0:6AFD48D3 |
| html-safe-nonce | 88e44f5c88a37a428f3609abd7e69c1a4134c1376fc306983eb2828faef58da3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzZBOjE4MEM2NTo2OUEyQTo4RURFMDo2QUZENDhEMyIsInZpc2l0b3JfaWQiOiI2OTI3ODQ0Njk5MDY3NDY3OTg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 10341488a990b8cf052e38a7b22393dae27de1ef81cffd83c66d70a874a5b8bf |
| hovercard-subject-tag | issue:511665136 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/10877/issue_layout |
| twitter:image | https://opengraph.githubassets.com/395d58c427c5d2ba3f120e32a80c776ba43f50712dd49ed28e0b2d38407f6678/PowerShell/PowerShell/issues/10877 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/395d58c427c5d2ba3f120e32a80c776ba43f50712dd49ed28e0b2d38407f6678/PowerShell/PowerShell/issues/10877 |
| og:image:alt | #10641 - The new error formatting is nice but it might have some disadvantages, too. Demo script function Test-Error { Write-Error @' Oops, error! Details: - Somewhat long details line 1, and more ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nightroman |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width