Skip to content
Merged
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
12 changes: 11 additions & 1 deletion Sources/WebDriver/ErrorResponse.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
public struct ErrorResponse: Codable, Error {
/// A response received when an error occurs when processing a request.
public struct ErrorResponse: Codable, Error, CustomStringConvertible {
public var status: Status
public var value: Value

public var description: String {
var str = "Error \(status.rawValue)"
if let error = value.error {
str += " (\(error))"
}
str += ": \(value.message)"
return str
}

// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#response-status-codes
public struct Status: Codable, Hashable, RawRepresentable {
public var rawValue: Int
Expand Down
Loading