From bedbcf252d63bcbfc3a4de24a5573667d86ca17d Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Fri, 8 Aug 2025 16:45:52 +0200 Subject: change write 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 b0f02c3..b74eef0 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -100,10 +100,11 @@ interface ProtocolTranslator { * @param fid The FID to write to. * @param offset The distance between the beginning of the file and the first written byte. * @param data The raw bytes that are going to be written. - * @return A pair of: (1) an optional error message and (2) the amount of bytes written with the call just made. If - * the string is not null, an error occurred and the amount of written bytes is going to be zero. + * @return The amount of bytes written 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 write(fid: UInt, offset: ULong, count: UInt, data: Iterable): Pair + fun write(fid: UInt, offset: ULong, count: UInt, data: Iterable): UInt /** * Forget about an FID. -- cgit v1.2.3