aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2024-02-21 11:11:12 +0000
committerPete Bentley <prb@google.com>2024-02-21 11:16:41 +0000
commit9e6fdcd34586b13a06798f0d4943adcb921a62ba (patch)
treec6cc957391d68c3de4fca5b5ad97cd6aeb87a37a
parent942ef2486b0d2c88d1362dae38513bd4fdf808db (diff)
downloadlibcore-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.java2
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();
}