Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 96ae82f

Browse files
committed
Remove an enum builder in favor of default associated value
1 parent ff552e0 commit 96ae82f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Sources/WordPressKit/WordPressAPI/WordPressAPIError.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ public enum WordPressAPIError<EndpointError>: Error where EndpointError: Localiz
1818
/// The API call returned an status code that's unacceptable to the endpoint.
1919
case unacceptableStatusCode(response: HTTPURLResponse, body: Data)
2020
/// The API call returned an HTTP response that WordPressKit can't parse. Receiving this error could be an indicator that there is an error response that's not handled properly by WordPressKit.
21-
case unparsableResponse(response: HTTPURLResponse?, body: Data?, underlyingError: Error)
21+
case unparsableResponse(response: HTTPURLResponse?, body: Data?, underlyingError: Error = URLError(.cannotParseResponse))
2222
/// Other error occured.
2323
case unknown(underlyingError: Error)
2424

25-
static func unparsableResponse(response: HTTPURLResponse?, body: Data?) -> Self {
26-
return WordPressAPIError<EndpointError>.unparsableResponse(response: response, body: body, underlyingError: URLError(.cannotParseResponse))
27-
}
2825

2926
var response: HTTPURLResponse? {
3027
switch self {

0 commit comments

Comments
 (0)