From 98e568c89fb5e8f5a3c118382af2a73119ad120d Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Thu, 7 Aug 2025 19:55:13 +0200 Subject: add MsizeValueTooBigException and UnknownVersionException --- src/main/kotlin/MsizeValueTooBigException.kt | 8 ++++++++ src/main/kotlin/UnknownVersionException.kt | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 src/main/kotlin/MsizeValueTooBigException.kt create mode 100644 src/main/kotlin/UnknownVersionException.kt (limited to 'src') diff --git a/src/main/kotlin/MsizeValueTooBigException.kt b/src/main/kotlin/MsizeValueTooBigException.kt new file mode 100644 index 0000000..873258b --- /dev/null +++ b/src/main/kotlin/MsizeValueTooBigException.kt @@ -0,0 +1,8 @@ +/** + * This exception is thrown when the `msize` value sent by the server is bigger than that sent by the client during the + * version transaction. + * + * @param maxClientValue The value requested by the client. + * @param receivedValue The value sent by the server. + */ +class MsizeValueTooBigException(val maxClientValue: UInt, val receivedValue: UInt) : Exception("Msize value too big: $receivedValue > $maxClientValue") \ No newline at end of file diff --git a/src/main/kotlin/UnknownVersionException.kt b/src/main/kotlin/UnknownVersionException.kt new file mode 100644 index 0000000..1f88a73 --- /dev/null +++ b/src/main/kotlin/UnknownVersionException.kt @@ -0,0 +1,7 @@ +/** + * This exception is thrown when the remote server sent either an "unknown" version back during the version negotiation + * procedure or a version unknown to this client implementation. + * + * @param version The version sent by the server. + */ +class UnknownVersionException(val version: String) : Exception("Unknown version: $version") \ No newline at end of file -- cgit v1.2.3