Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug/v4 get se element error management #145

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

Merged
itfranck merged 4 commits into V4 from bug/v4-GetSeElementErroManagement
Sep 30, 2020

Conversation

Copy link
Collaborator

@itfranck itfranck commented Sep 30, 2020


if ($null -eq $Output) {
$Message = "no such element: Unable to locate element by: $($By -join ',') with value $($Value -join ',')"
Write-Error -Exception ([System.InvalidOperationException]::new($Message))
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about using [System.Management.Automation.ItemNotFoundException] instead?

IMO InvalidOperation is generally used for things that would never work and can communicate that user input is somehow completely unusable, which doesn't feel like is the case here. 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vexx32 Yes, I like yours better.

I used InvalidOperation because that's what the native call produced and didn't have ItemNotFound exception in mind.

Making the change right now.

vexx32 reacted with heart emoji
@itfranck itfranck merged commit 89333bd into V4 Sep 30, 2020
@itfranck itfranck deleted the bug/v4-GetSeElementErroManagement branch September 30, 2020 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@vexx32 vexx32 vexx32 left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /