17 lines
863 B
Kotlin
17 lines
863 B
Kotlin
package org.hso.texturesyncclient.controller.net
|
|
|
|
import com.google.gson.JsonSyntaxException
|
|
import java.lang.Exception
|
|
|
|
|
|
|
|
sealed class ConnectionException(val msg : String) : Exception(msg)
|
|
class ConnectionErrorException(val error : ErrorPacket) : ConnectionException("${error.code} ${error.message}")
|
|
class ConnectionUnexpectedPacket() : ConnectionException("Got Unexpected Type of Packet")
|
|
class ConnectionInvalidJsonException(val jsonError : JsonSyntaxException) : ConnectionException("The Format of the Json Received is Unexpected.")
|
|
|
|
sealed class PacketException(msg: String) : ConnectionException(msg)
|
|
class PacketTooLongException : PacketException("The Package is too long.")
|
|
class PacketInvalidType : PacketException("The Package has an Invalid Type.")
|
|
class PacketInvalidData : PacketException("The Package has an Invalid Data. (e.g. Invalid Json.)")
|