Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cascade ws client error to promise #2041

Merged
merged 1 commit into from Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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