diff options
author | Pete Bentley <prb@google.com> | 2024-02-21 11:11:12 +0000 |
---|---|---|
committer | Pete Bentley <prb@google.com> | 2024-02-21 11:16:41 +0000 |
commit | 9e6fdcd34586b13a06798f0d4943adcb921a62ba (patch) | |
tree | c6cc957391d68c3de4fca5b5ad97cd6aeb87a37a | |
parent | 942ef2486b0d2c88d1362dae38513bd4fdf808db (diff) | |
download | libcore-9e6fdcd34586b13a06798f0d4943adcb921a62ba.tar.gz |
Add cause when throwing from socketAccept().
Seems to be the only exceptional way out of
PlainSocketImpl methods that doesn't include
the initial ErrnoException as a cause.
Bug: 322012313
Test: N/A
Change-Id: Ib68ed18cc29512e3f1ced3fa1d5b024c444b82be
-rw-r--r-- | ojluni/src/main/java/java/net/PlainSocketImpl.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ojluni/src/main/java/java/net/PlainSocketImpl.java b/ojluni/src/main/java/java/net/PlainSocketImpl.java index 89ee53e8486..d198828f0a6 100644 --- a/ojluni/src/main/java/java/net/PlainSocketImpl.java +++ b/ojluni/src/main/java/java/net/PlainSocketImpl.java @@ -210,7 +210,7 @@ class PlainSocketImpl extends AbstractPlainSocketImpl e.initCause(errnoException); throw e; } else if (errnoException.errno == EINVAL || errnoException.errno == EBADF) { - throw new SocketException("Socket closed"); + throw new SocketException("Socket closed", errnoException); } errnoException.rethrowAsSocketException(); } |