Skip to content

Commit 3ee9c0b

Browse files
brianquinlanCommit Queue
authored andcommitted
Document that Socket.addError throws.
Bug:#31504 Change-Id: Ib9f9b0fb2844b92fe5375da9b843b1d9777a936a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278947 Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Brian Quinlan <[email protected]>
1 parent 03e1659 commit 3ee9c0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sdk/lib/_internal/vm/bin/socket_patch.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,10 @@ class _Socket extends Stream<Uint8List> implements Socket {
22262226

22272227
void add(List<int> bytes) => _sink.add(bytes);
22282228

2229+
/// Unsupported operation on sockets.
2230+
///
2231+
/// Throws an [UnsupportedError] because errors cannot be transmitted over a
2232+
/// [Socket].
22292233
void addError(Object error, [StackTrace? stackTrace]) {
22302234
throw new UnsupportedError("Cannot send errors on sockets");
22312235
}

0 commit comments

Comments
 (0)