File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Sources/SwiftAPIClient/Modifiers/TokenRefresher Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments