Skip to content

Don't format exceptions that aren't ErrorRecords - #11415

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:concise-exception
Dec 21, 2019
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:concise-exception

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 20, 2019 •

Copy link
Copy Markdown
Member

PR Summary

In one of the previous PRs for ConciseView, System.Exception was incorrectly added to the typenames handled by the ErrorRecord formatting. This results in just Exception objects written to the console to not be rendered since the ErrorRecord formatting didn't handle this situation. Fix is to remove the line to add that type putting it back to how it was previously. Also made the handling of ErrorRecord a bit more robust just in case Exception.Message doesn't exist nor a Message property.

PR Context

Fix #11413

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) added this to the GA-consider milestone Dec 20, 2019
@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 21, 2019
@iSazonov
Ilya (iSazonov) merged commit 5b42126 into PowerShell:master Dec 21, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the concise-exception branch December 23, 2019 18:56
Dongbo Wang (daxian-dbw) pushed a commit that referenced this pull request Jan 10, 2020
* In one of the previous PRs for ConciseView, System.Exception was incorrectly added to the typenames handled by the ErrorRecord formatting. This results in just Exception objects written to the console to not be rendered since the ErrorRecord formatting didn't handle this situation. Fix is to remove the line to add that type putting it back to how it was previously. 

* Also made the handling of ErrorRecord a bit more robust just in case Exception.Message doesn't exist nor a Message property.
@ghost

Copy link
Copy Markdown

🎉v7.0.0-rc.2 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
* In one of the previous PRs for ConciseView, System.Exception was incorrectly added to the typenames handled by the ErrorRecord formatting. This results in just Exception objects written to the console to not be rendered since the ErrorRecord formatting didn't handle this situation. Fix is to remove the line to add that type putting it back to how it was previously. 

* Also made the handling of ErrorRecord a bit more robust just in case Exception.Message doesn't exist nor a Message property.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting for unthrown exception incorrect

4 participants