Skip to content

Commit 282b40a

Browse files
authored
Response.Error (Event) fix (#7)
1 parent 8fc2ca8 commit 282b40a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/Conversation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ private extension Conversation {
274274
webSearch.status = .completed
275275
item = .webSearchCall(webSearch)
276276
}
277-
case let .error(code, message, param):
278-
throw Response.Error(type: "streaming_error", message: message, code: code, param: param)
277+
case let .error(error):
278+
throw error
279279
case let .fileSearchCallInitiated(itemId: itemId, outputIndex: outputIndex):
280280
updateItem(index: outputIndex, id: itemId) { item in
281281
guard case var .fileSearch(fileSearch) = item else { return }

src/Models/Event.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,7 @@ import MetaCodable
233233

234234
/// Emitted when an error occurs.
235235
///
236-
/// - Parameter code: The error code.
237-
/// - Parameter message: The error message.
238-
/// - Parameter param: The error parameter.
236+
/// - Parameter error: The error that occurred.
239237
@CodedAs("error")
240-
case error(
241-
code: String?,
242-
message: String,
243-
param: String?
244-
)
238+
case error(error: Response.Error)
245239
}

0 commit comments

Comments
 (0)