Skip to content

Commit

Permalink
cascade ws client error to promise (#2041)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Aug 27, 2019
1 parent 3a65a17 commit 098c120
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Tests/VaporTests/ApplicationTests.swift
Expand Up @@ -394,7 +394,7 @@ final class ApplicationTests: XCTestCase {
let app = Application.create(routes: { r, c in
r.get("ws") { req -> EventLoopFuture<String> in
let promise = req.eventLoop.makePromise(of: String.self)
return WebSocket.connect(
WebSocket.connect(
to: "ws://echo.websocket.org/",
on: req.eventLoop
) { ws in
Expand All @@ -403,9 +403,8 @@ final class ApplicationTests: XCTestCase {
promise.succeed(text)
ws.close().cascadeFailure(to: promise)
}
}.flatMap {
return promise.futureResult
}
}.cascadeFailure(to: promise)
return promise.futureResult
}
})
defer { app.shutdown() }
Expand Down

0 comments on commit 098c120

Please sign in to comment.