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

Match error type name to filename #160

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/WebDriver/NoSuchElementError.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Thrown when findElement fails to locate an element.
public struct ElementNotFoundError: Error, CustomStringConvertible {
public struct NoSuchElementError: Error, CustomStringConvertible {
/// The locator that was used to search for the element.
public var locator: ElementLocator

Expand All @@ -15,6 +15,6 @@ public struct ElementNotFoundError: Error, CustomStringConvertible {
public var errorResponse: ErrorResponse? { sourceError as? ErrorResponse }

public var description: String {
"Element not found using locator [\(locator.using)=\(locator.value)]: \(sourceError)"
"No element found using locator [\(locator.using)=\(locator.value)]: \(sourceError)"
}
}
2 changes: 1 addition & 1 deletion Sources/WebDriver/Session.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public class Session {
}
}
} catch {
throw ElementNotFoundError(locator: locator, sourceError: error)
throw NoSuchElementError(locator: locator, sourceError: error)
}
}
}
Expand Down
Loading