Skip to content

Commit 5d1374b

Browse files
committed
Remove unused code
1 parent c936d02 commit 5d1374b

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

Modules/Sources/NetworkingCore/Model/DotcomError.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ public extension NetworkError {
177177
guard let originalNetworkError = originalNetworkError else {
178178
// No original NetworkError - this is likely from successful HTTP response with API error content
179179
let (code, message) = dotcomError.getCodeAndMessage()
180-
let errorData = dotcomError.createEnhancedErrorResponseData(originalResponse: nil)
180+
let errorData = dotcomError.createEnhancedErrorResponseData()
181181
return .apiError(code: code, message: message, response: errorData)
182182
}
183183

184-
let enhancedErrorData = dotcomError.createEnhancedErrorResponseData(originalResponse: originalNetworkError.response)
184+
let enhancedErrorData = dotcomError.createEnhancedErrorResponseData()
185185

186186
switch originalNetworkError {
187187
case .notFound:
@@ -205,7 +205,7 @@ public extension NetworkError {
205205
//
206206
private extension DotcomError {
207207
/// Creates enhanced JSON error response data that preserves original response while adding structured error details
208-
func createEnhancedErrorResponseData(originalResponse: Data?) -> Data? {
208+
func createEnhancedErrorResponseData() -> Data? {
209209
let (code, message) = getCodeAndMessage()
210210

211211
let errorResponse: [String: Any] = [

Modules/Sources/NetworkingCore/Network/NetworkError.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extension NetworkError: CustomStringConvertible {
164164

165165
public extension NetworkError {
166166
/// Returns true if this error represents a "not found" condition
167+
// periphery:ignore - TODO: remove this ignore when we merge NetworkError use
167168
var isNotFound: Bool {
168169
switch self {
169170
case .notFound:
@@ -176,6 +177,7 @@ public extension NetworkError {
176177
}
177178

178179
/// Returns true if this error represents an authorization issue
180+
// periphery:ignore - TODO: remove this ignore when we merge NetworkError use
179181
var isUnauthorized: Bool {
180182
switch self {
181183
case .invalidCookieNonce:
@@ -190,6 +192,7 @@ public extension NetworkError {
190192
}
191193

192194
/// Returns true if this error represents a timeout
195+
// periphery:ignore - TODO: remove this ignore when we merge NetworkError use
193196
var isTimeout: Bool {
194197
switch self {
195198
case .timeout:
@@ -202,6 +205,7 @@ public extension NetworkError {
202205
}
203206

204207
/// Returns true if this error represents invalid input/parameters
208+
// periphery:ignore - TODO: remove this ignore when we merge NetworkError use
205209
var isInvalidInput: Bool {
206210
switch self {
207211
case .unacceptableStatusCode(let statusCode, _):
@@ -212,6 +216,7 @@ public extension NetworkError {
212216
}
213217

214218
/// Returns a user-friendly error message, preferring API error message over generic description
219+
// periphery:ignore - TODO: remove this ignore when we merge NetworkError use
215220
var userFriendlyMessage: String {
216221
return apiErrorMessage ?? localizedDescription
217222
}
@@ -220,12 +225,7 @@ public extension NetworkError {
220225
// MARK: - Supporting Types
221226

222227
/// Represents error details from API response JSON
223-
public struct APIErrorDetails: Codable {
224-
public let code: String
225-
public let message: String?
226-
227-
public init(code: String, message: String?) {
228-
self.code = code
229-
self.message = message
230-
}
228+
struct APIErrorDetails: Codable {
229+
let code: String
230+
let message: String?
231231
}

Modules/Sources/Yosemite/Tools/CommonReaderConfigProvider.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,3 @@ private extension CardReaderConfigError {
8383
}
8484
}
8585
}
86-
87-
private struct CardReaderConfigNetworkErrorDetails: Decodable {
88-
let code: ErrorCode
89-
let message: String?
90-
91-
enum CodingKeys: CodingKey {
92-
case code
93-
case message
94-
}
95-
96-
enum ErrorCode: String, Decodable {
97-
case storeAddressIncomplete = "store_address_is_incomplete"
98-
case postalCodeInvalid = "postal_code_invalid"
99-
}
100-
}

0 commit comments

Comments
 (0)