File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
APIClientInterface/Sources/Error Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 55// Copyright © 2025 wafflestudio.com. All rights reserved.
66//
77
8+ import Foundation
89import OpenAPIRuntime
910
1011public enum APIClientError : Error {
@@ -53,4 +54,14 @@ extension Error {
5354 false
5455 }
5556 }
57+
58+ public var isTimeoutError : Bool {
59+ switch self {
60+ case let error as ClientError :
61+ let nsError = error. underlyingError as NSError
62+ return nsError. domain == NSURLErrorDomain && nsError. code == NSURLErrorTimedOut
63+ default :
64+ return false
65+ }
66+ }
5667}
Original file line number Diff line number Diff line change @@ -40,18 +40,16 @@ public struct ThemeAPIRepository: ThemeRepository {
4040}
4141
4242extension Theme {
43+ private var colorPayloads : [ Components . Schemas . ColorSet ] {
44+ colors. map { . init( bg: $0. bgHex, fg: $0. fgHex) }
45+ }
46+
4347 fileprivate func toAddPayload( ) -> Components . Schemas . TimetableThemeAddRequestDto {
44- . init(
45- colors: colors. map { . init( bg: $0. bgHex, fg: $0. fgHex) } ,
46- name: name
47- )
48+ . init( colors: colorPayloads, name: name)
4849 }
4950
5051 fileprivate func toModifyPayload( ) -> Components . Schemas . TimetableThemeModifyRequestDto {
51- . init(
52- colors: colors. map { . init( bg: $0. bgHex, fg: $0. fgHex) } ,
53- name: name
54- )
52+ . init( colors: colorPayloads, name: name)
5553 }
5654}
5755
You can’t perform that action at this time.
0 commit comments