exception property

StreamException get exception

The exception this disconnection is reported as.

The cause where there is one, and a StreamNetworkException describing the closure otherwise, so every disconnection can be raised whether or not it carried a failure.

Implementation

StreamException get exception => cause ?? StreamNetworkException(message: closeReason);