mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8299475: Enhance SocketException by cause where it is missing in net and nio area
Reviewed-by: alanb
This commit is contained in:
parent
2ccdefc81c
commit
c929d8be5d
4 changed files with 25 additions and 8 deletions
|
@ -299,7 +299,7 @@ public class ServerSocket implements java.io.Closeable {
|
|||
} catch (SocketException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw new SocketException(e.getMessage());
|
||||
throw new SocketException(e.getMessage(), e);
|
||||
}
|
||||
created = true;
|
||||
}
|
||||
|
|
|
@ -531,8 +531,10 @@ public class Socket implements java.io.Closeable {
|
|||
try {
|
||||
impl.create(stream);
|
||||
created = true;
|
||||
} catch (SocketException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw new SocketException(e.getMessage());
|
||||
throw new SocketException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -363,7 +363,7 @@ class SocksSocketImpl extends DelegatingSocketImpl implements SocksConsts {
|
|||
try {
|
||||
privilegedConnect(server, serverPort, remainingMillis(deadlineMillis));
|
||||
} catch (IOException e) {
|
||||
throw new SocketException(e.getMessage());
|
||||
throw new SocketException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue