From 86df6e5f503f6675d39377370276d9f09c0043ef Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Thu, 7 Aug 2025 20:05:46 +0200 Subject: move MsizeValueTooBigException to except package --- src/main/kotlin/Connection.kt | 1 + src/main/kotlin/MsizeValueTooBigException.kt | 8 -------- src/main/kotlin/ProtocolTranslator.kt | 2 +- src/main/kotlin/except/MsizeValueTooBigException.kt | 10 ++++++++++ 4 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 src/main/kotlin/MsizeValueTooBigException.kt create mode 100644 src/main/kotlin/except/MsizeValueTooBigException.kt diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt index 9982e76..4f920b7 100644 --- a/src/main/kotlin/Connection.kt +++ b/src/main/kotlin/Connection.kt @@ -1,3 +1,4 @@ +import except.MsizeValueTooBigException import java.io.IOException import java.math.BigInteger diff --git a/src/main/kotlin/MsizeValueTooBigException.kt b/src/main/kotlin/MsizeValueTooBigException.kt deleted file mode 100644 index 873258b..0000000 --- a/src/main/kotlin/MsizeValueTooBigException.kt +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt index 686e05e..9e5632b 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -29,7 +29,7 @@ interface ProtocolTranslator { * @param version Should be "9P2000", which is the only defined value. * @throws except.InvalidMessageException if the received message is invalid. * @throws RErrorException if the received message is an R-error message. - * @throws MsizeValueTooBigException if the received `msize` value is bigger than what the client requested. + * @throws except.MsizeValueTooBigException if the received `msize` value is bigger than what the client requested. * @throws UnknownVersionException if the version negotiation failed. */ fun version(msize: UInt, version: String) diff --git a/src/main/kotlin/except/MsizeValueTooBigException.kt b/src/main/kotlin/except/MsizeValueTooBigException.kt new file mode 100644 index 0000000..f1f6da1 --- /dev/null +++ b/src/main/kotlin/except/MsizeValueTooBigException.kt @@ -0,0 +1,10 @@ +package except + +/** + * 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 -- cgit v1.2.3