From 9bf06f0575e2552cf6dfebb057e5b799ead4ea9f Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Thu, 7 Aug 2025 20:07:38 +0200 Subject: move RErrorException to except package --- src/main/kotlin/Connection.kt | 3 ++- src/main/kotlin/ProtocolTranslator.kt | 2 +- src/main/kotlin/RErrorException.kt | 6 ------ src/main/kotlin/except/RErrorException.kt | 8 ++++++++ 4 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 src/main/kotlin/RErrorException.kt create mode 100644 src/main/kotlin/except/RErrorException.kt diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt index 4f920b7..61cbaae 100644 --- a/src/main/kotlin/Connection.kt +++ b/src/main/kotlin/Connection.kt @@ -1,4 +1,5 @@ import except.MsizeValueTooBigException +import except.RErrorException import java.io.IOException import java.math.BigInteger @@ -62,7 +63,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator { * with no message, or non-empty with the error message) and (2) the optional [InMessage] instance (null if an error * occurred). * @throws except.InvalidMessageException if the received message is invalid. - * @throws RErrorException if the received message is an R-error message. + * @throws except.RErrorException if the received message is an R-error message. */ private fun checkedInMessage(reqTag: UShort): InMessage { val imsg = InMessage(this.tl, this.maxSize, reqTag) diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt index 9e5632b..ffa5f44 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -28,7 +28,7 @@ interface ProtocolTranslator { * 9P message. * @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 except.RErrorException if the received message is an R-error message. * @throws except.MsizeValueTooBigException if the received `msize` value is bigger than what the client requested. * @throws UnknownVersionException if the version negotiation failed. */ diff --git a/src/main/kotlin/RErrorException.kt b/src/main/kotlin/RErrorException.kt deleted file mode 100644 index 56fdebc..0000000 --- a/src/main/kotlin/RErrorException.kt +++ /dev/null @@ -1,6 +0,0 @@ -/** - * This exception represents an error sent by the remote server as an R-error message. - * - * @param message The message sent by the server. - */ -class RErrorException(val rErrorMessage: String?) : Exception("R-error message received: $rErrorMessage") \ No newline at end of file diff --git a/src/main/kotlin/except/RErrorException.kt b/src/main/kotlin/except/RErrorException.kt new file mode 100644 index 0000000..c15cbc2 --- /dev/null +++ b/src/main/kotlin/except/RErrorException.kt @@ -0,0 +1,8 @@ +package except + +/** + * This exception represents an error sent by the remote server as an R-error message. + * + * @param message The message sent by the server. + */ +class RErrorException(val rErrorMessage: String?) : Exception("R-error message received: $rErrorMessage") \ No newline at end of file -- cgit v1.2.3