Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid try/catch for 'DarkYellow' #806

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Avoid try/catch for 'DarkYellow' #806

merged 2 commits into from
Oct 27, 2020

Conversation

dahlbyk
Copy link
Owner

@dahlbyk dahlbyk commented Oct 27, 2020

Error log in #771 (comment) pointed out using 'DarkYellow' ends up polluting $Errors with:

Exception calling "FromHtml" with "1" argument(s): "DarkYellow is not a valid value for Int32."
At C:\Dev\OSS\posh-git\src\AnsiUtils.ps1:70 char:17
+                 $color = $ColorTranslatorType::FromHtml($color)

Since DarkYellow is the only [ConsoleColor] that's not also represented in HTML, a hard-coded exception seems appropriate.

cc #536

@dahlbyk dahlbyk self-assigned this Oct 27, 2020
@dahlbyk dahlbyk added this to the v1.0 milestone Oct 27, 2020
src/AnsiUtils.ps1 Outdated Show resolved Hide resolved
src/AnsiUtils.ps1 Outdated Show resolved Hide resolved
Copy link
Collaborator

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor knits otherwise LGTM.

@dahlbyk
Copy link
Owner Author

dahlbyk commented Oct 27, 2020

Minor knits otherwise LGTM.

Better?

@rkeithhill
Copy link
Collaborator

Yup. LGTM.

@dahlbyk dahlbyk merged commit 43e2bf7 into master Oct 27, 2020
@dahlbyk dahlbyk deleted the DarkYellow branch October 27, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants