From 49df0ed8565a6f084e35c032de377a1986a882a0 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Fri, 25 Oct 2024 22:12:46 -0400 Subject: [PATCH] Match error type name to filename (#160) --- Sources/WebDriver/NoSuchElementError.swift | 4 ++-- Sources/WebDriver/Session.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/WebDriver/NoSuchElementError.swift b/Sources/WebDriver/NoSuchElementError.swift index 9f538ea..9da4cfd 100644 --- a/Sources/WebDriver/NoSuchElementError.swift +++ b/Sources/WebDriver/NoSuchElementError.swift @@ -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 @@ -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)" } } diff --git a/Sources/WebDriver/Session.swift b/Sources/WebDriver/Session.swift index 9aa1081..c812b02 100644 --- a/Sources/WebDriver/Session.swift +++ b/Sources/WebDriver/Session.swift @@ -186,7 +186,7 @@ public class Session { } } } catch { - throw ElementNotFoundError(locator: locator, sourceError: error) + throw NoSuchElementError(locator: locator, sourceError: error) } } }