Skip to content

Commit 1f13ca1

Browse files
committed
hm
1 parent b0bf397 commit 1f13ca1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public struct TokenRefresherMiddleware: HTTPClientMiddleware {
139139
try await requestToken(configs)
140140
}
141141
} else {
142-
throw TokenNotFound()
142+
throw TokenNotFound(name: "accessToken")
143143
}
144144

145145
if
@@ -185,7 +185,15 @@ public struct TokenRefresherMiddleware: HTTPClientMiddleware {
185185
}
186186
}
187187

188-
public struct TokenNotFound: Error {
188+
public struct TokenNotFound: Error, CustomStringConvertible {
189189

190-
public init() {}
190+
public let name: String?
191+
192+
public var description: String {
193+
"TokenNotFound\(name.map { ": \($0)" } ?? "")"
194+
}
195+
196+
public init(name: String? = nil) {
197+
self.name = name
198+
}
191199
}

0 commit comments

Comments
 (0)