Skip to content

Commit

Permalink
Better error message. (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Feb 28, 2025
1 parent 1d96316 commit 4407cb4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/net/modules/tcp.toit
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ tcp-write_ socket-resource-group descriptor data from to:
// might abort the write once the buffer is full and the written
// size is not equal to the size we requested to write.
#primitive.tcp.write: | error |
if error == "WRONG_OBJECT_TYPES" and not descriptor: throw "ALREADY_CLOSED"
if error != "WRONG_BYTES_TYPE": throw error
List.chunk-up from to 4096: | chunk-from chunk-to chunk-size |
chunk := ByteArray.from data chunk-from chunk-to
Expand Down

0 comments on commit 4407cb4

Please sign in to comment.