-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[dotnet] Modernize Response
type
#14839
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Thank you @RenderMichael ! |
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Modernizes the
Response
class, in preparation for making it null-safe. I separated this out into a separate PR because the diffs were becoming unwieldy. The changes in this PR may be uncontroversial, and should be considered separate from any other changes to it.Motivation and Context
This simplifies and shrinks the code.
Types of changes
Checklist
PR Type
enhancement
Description
Response
class by removing redundant fields and using auto-properties, which simplifies the code and reduces its size.FromErrorJson
method to use the newResponse
constructor, ensuring consistent error response creation.ExecuteAsync
method ofWebDriver
by utilizing the newResponse
constructor for error responses.Changes walkthrough 📝
Response.cs
Modernize and simplify the `Response` class in WebDriver
dotnet/src/webdriver/Response.cs
Response
class by removing redundant fields and usingauto-properties.
FromErrorJson
method.WebDriver.cs
Simplify error handling in WebDriver's ExecuteAsync method
dotnet/src/webdriver/WebDriver.cs
ExecuteAsync
method.Response
constructor for error responses.