diff options
author | Edoardo La Greca | 2025-08-08 16:45:52 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-08 16:45:52 +0200 |
commit | bedbcf252d63bcbfc3a4de24a5573667d86ca17d (patch) | |
tree | 4a83e634bb383bd57671743f9ae4ea601eb1ec98 /src/main/kotlin/ProtocolTranslator.kt | |
parent | 946e0e2d438f1076ea009901b1a69cb49425865f (diff) |
change write to use exceptions instead of error strings
Diffstat (limited to 'src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r-- | src/main/kotlin/ProtocolTranslator.kt | 7 |
1 files changed, 4 insertions, 3 deletions
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<UByte>): Pair<String?, UInt> + fun write(fid: UInt, offset: ULong, count: UInt, data: Iterable<UByte>): UInt /** * Forget about an FID. |