From 946e0e2d438f1076ea009901b1a69cb49425865f Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Fri, 8 Aug 2025 16:43:42 +0200 Subject: change read to use exceptions instead of error strings --- src/main/kotlin/ProtocolTranslator.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/ProtocolTranslator.kt') diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt index bf29131..b0f02c3 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -87,10 +87,11 @@ interface ProtocolTranslator { * Transfer data from file. Due to the negotiated maximum size of 9P messages, called `msize`, one is supposed to * call this method multiple times, unless the content is smaller than `msize`. * - * @return A pair of: (1) an optional error message and (2) the content read with the call just made. If the string - * is not null, an error occurred and the array is going to be empty. + * @return The content read with the call just made. + * @throws except.InvalidMessageException if the received message is invalid. + * @throws except.RErrorException if the received message is an R-error message. */ - fun read(fid: UInt, offset: ULong, count: UInt): Pair> + fun read(fid: UInt, offset: ULong, count: UInt): Array /** * Transfer data to file. Due to the negotiated maximum size of 9P messages, called `msize`, one is supposed to -- cgit v1.2.3