All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.petretiandrea.socket.exception.SocketException.kt Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package io.github.petretiandrea.socket.exception

enum class SocketErrorReason(val message: String) {
    PEER_CLOSED("Peer closed connection"),
    TIMEOUT("Timeout error"),
    IO("IO error"),
    UNKNOWN("unknown error")
}

data class SocketException(
    val reason: SocketErrorReason,
    val additionalMessage: String = ""
) : Exception("${reason.message}, $additionalMessage") {
    constructor(message: String) : this(SocketErrorReason.UNKNOWN, message)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy