Skip to content

Commit

Permalink
Update function error handling.
Browse files Browse the repository at this point in the history
Add throws
Remove DO - CATCH
  • Loading branch information
eBlender committed Jan 15, 2025
1 parent 7356cf9 commit 75a7574
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions FirebaseFunctions/Tests/Unit/FunctionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,12 @@ class FunctionsTests: XCTestCase {
waitForExpectations(timeout: 1.5)
}

func testGenerateStreamContent() async {
func testGenerateStreamContent() async throws {
let options = HTTPSCallableOptions(requireLimitedUseAppCheckTokens: true)
var response = [String]()
let responseQueue = DispatchQueue(label: "responseQueue")

let input: [String: Any] = ["data": "Why is the sky blue"]
do {
let stream = try await functions?.stream(
at: URL(string: "http://127.0.0.1:5001/demo-project/us-central1/genStream")!,
withObject: input,
Expand Down Expand Up @@ -403,9 +402,7 @@ class FunctionsTests: XCTestCase {
]
)
}
} catch {
XCTExpectFailure("Failed to download stream: \(error)")
}
XCTExpectFailure("Failed to download stream")
}

func testGenerateStreamContentCanceled() async {
Expand Down

0 comments on commit 75a7574

Please sign in to comment.