Skip to content

Commit f167434

Browse files
committed
remove two FIXME : handleCOmmonError always throws
1 parent 9dc024e commit f167434

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

swift-bedrock-library/Sources/BedrockService/BedrockService.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public struct BedrockService: Sendable {
151151
return BedrockRuntimeClient(config: config)
152152
}
153153

154-
func handleCommonError(_ error: Error, context: String) throws {
154+
func handleCommonError(_ error: Error, context: String) throws -> Never {
155155
if let commonError = error as? CommonRunTimeError {
156156
logger.trace("CommonRunTimeError while \(context)", metadata: ["error": "\(error)"])
157157
switch commonError {
@@ -208,7 +208,6 @@ public struct BedrockService: Sendable {
208208
return modelsInfo
209209
} catch {
210210
try handleCommonError(error, context: "listing foundation models")
211-
throw BedrockServiceError.unknownError("\(error)") // FIXME: handleCommonError will always throw
212211
}
213212
}
214213
}

swift-bedrock-library/Sources/BedrockService/Converse/BedrockService+ConverseStreaming.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ extension BedrockService {
134134

135135
} catch {
136136
try handleCommonError(error, context: "invoking converse stream")
137-
throw BedrockServiceError.unknownError("\(error)") // FIXME: handleCommonError will always throw
138137
}
139138
}
140139

0 commit comments

Comments
 (0)