Vapor: 4.0.0-beta.4.2 Release

Release date:
February 27, 2020
Previous version:
4.0.0-beta.4.1 (released February 27, 2020)
Magnitude:
0 Diff Delta
Contributors:
1 total committer
Data confidence:
Commits:

Top Contributors in 4.0.0-beta.4.2

bridger

Directory Browser for 4.0.0-beta.4.2

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

Improves error handling on WebSocket connections. Improvements to WebSocket-Kit intercept errors or timeouts at the ChannelHandler level and expose them to the WebSocket class.

Now, when an error occurs (such as a malformed WebSocket frame) the error is available via the closeCode on WebSocket. Example:

func connected(request: Request, connection: WebSocket) {
  _ = connection.onClose.always { (result) in
      let closeReason = connectionInfo.connection.closeCode ?? .unknown(0)
      // Application-specific cleanup code here
  }

}

This patch was authored by @bridger and released by @tanner0101.