Skip to content

Part 2 - Improve ValidateCount attribute error message - #3656

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
iSazonov:validatecount-message2
May 2, 2017
Merged

Part 2 - Improve ValidateCount attribute error message#3656
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
iSazonov:validatecount-message2

Conversation

@iSazonov

Copy link
Copy Markdown
Collaborator

Based on discussion #3596 (comment)

Leave only two message for:

  1. Count is not in allowed range.
  2. Count is not exactly equal allowed value.

/cc Jason Shirk (@lzybkr) Michael Klement (@mklement0)

Leave only two message for:
1. Count is not in allowed range.
2. Count is not exactly equal allowed value.
@iSazonov

Copy link
Copy Markdown
Collaborator Author

Mac build temporary failed.

throw new ValidationMetadataException("ValidateCountSmallerThanMin",
null, Metadata.ValidateCountFailure,
MinLength, MaxLength, len);
throw new ValidationMetadataException("ValidateCountExactlyFailure",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall, but I suggest removing the "ly": ValidateCountExactlyFailure -> ValidateCountExactFailure

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Fixed.

@iSazonov
Ilya (iSazonov) force-pushed the validatecount-message2 branch from 1583c3b to bdd53bf Compare April 28, 2017 03:54
@daxian-dbw

Copy link
Copy Markdown
Member

Jason Shirk (@lzybkr) the FullyQualifiedErrorId changed with this PR, does it need to be reviewed by powershell committee as a breaking change?

@lzybkr

Copy link
Copy Markdown
Contributor

We should document the change, but it's an unlikely breaking change - changing the exception type would be worth discussing, but in this specific case, the error id isn't very interesting.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 3d7ef43 into PowerShell:master May 2, 2017
@iSazonov
Ilya (iSazonov) deleted the validatecount-message2 branch May 3, 2017 03:04
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
Leave only two message for ValidateCount attribute error:
1. Count is not in allowed range.
2. Count is not exactly equal allowed value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants