You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify that the new fragment '#invalidselectorexception' matches the actual anchor on the documentation site and that BASE_SUPPORT_URL already points to the errors page, yielding a valid URL when concatenated.
Confirm the ERROR_URL base and new fragments produce valid links for all mapped errors and that unmapped errors (e.g., NoSuchDriverError with different structure) still resolve correctly.
Ensure 'supportUrl' visibility and naming (private static vs const/readonly) aligns with usage across the codebase; if used externally or for formatting messages, access modifiers may need to be reconsidered.
Hard-coding per-exception anchor fragments across bindings is brittle and will break when the docs’ heading slugs change. Centralize fragment generation (e.g., derive from the exception class name using the site’s slug rules with a fallback to the base errors page) or reference a stable redirect so future site updates don’t require code changes in multiple languages. This reduces maintenance risk and keeps error messages resilient to documentation restructuring.
// In a central helper or base class (e.g., C#)publicabstractclassWebDriverException : Exception
{
publicvirtualstringSupportUrl
{
get
{
// Generate slug from class name, e.g., "InvalidSelectorException" -> "invalidselectorexception"stringslug = GetType().Name.ToLower().Replace("exception", "");
return$"{baseSupportUrl}#{slug}";
}
}
}
// Exception classes no longer need hard-coded URLspublicclassInvalidSelectorException : WebDriverException { }
publicclassNoSuchElementException : NotFoundException { }
Suggestion importance[1-10]: 9
__
Why: This is an excellent suggestion that addresses the root cause of the issue, which is a brittle design, rather than just fixing the symptom, significantly improving long-term maintainability across multiple languages.
High
Learned best practice
Use string interpolation over concatenation
Use C# string interpolation instead of concatenation to improve readability and reduce errors. Update the assignment to use an interpolated string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
Fixes #16302
Supersedes #16297
💥 What does this PR do?
Fixes links to exception documentation in error messages and tests.
🔄 Types of changes
PR Type
Bug fix
Description
Fix broken documentation links in exception classes
Update URL fragments to match website structure
Standardize exception documentation references across languages
Diagram Walkthrough
File Walkthrough
7 files
Update documentation URL fragmentUpdate documentation URL fragmentUpdate documentation URL fragmentUpdate documentation URL fragmentUpdate documentation URL fragmentUpdate documentation URL fragmentUpdate exception documentation URLs3 files
Update test expectations for URL fragmentsUpdate test expectations for URL fragmentsUpdate test expectations for URL fragments