mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 13:35:22 +02:00
[235284][dstore] Safer error reporting for invalid daemon port number
This commit is contained in:
parent
1484919e21
commit
5ff3e6882d
1 changed files with 7 additions and 10 deletions
|
@ -786,19 +786,17 @@ public class ClientConnection
|
||||||
result = new ConnectionStatus(false, e, true, mgr.getUntrustedCerts());
|
result = new ConnectionStatus(false, e, true, mgr.getUntrustedCerts());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
|
||||||
e = new IllegalArgumentException(INVALID_DAEMON_PORT_NUMBER);
|
|
||||||
result = new ConnectionStatus(false, e);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (_launchSocket != null)
|
if (_launchSocket != null)
|
||||||
{
|
{
|
||||||
_launchSocket.close();
|
_launchSocket.close();
|
||||||
}
|
}
|
||||||
|
if (daemonPort <= 0 || daemonPort > 65535) {
|
||||||
result = new ConnectionStatus(false, e);
|
result = new ConnectionStatus(false, INVALID_DAEMON_PORT_NUMBER);
|
||||||
|
} else {
|
||||||
|
result = new ConnectionStatus(false, e);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -827,8 +825,7 @@ public class ClientConnection
|
||||||
result = new ConnectionStatus(false, uhe);
|
result = new ConnectionStatus(false, uhe);
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
catch (IllegalArgumentException e) {
|
||||||
e = new IllegalArgumentException(INVALID_DAEMON_PORT_NUMBER);
|
result = new ConnectionStatus(false, INVALID_DAEMON_PORT_NUMBER);
|
||||||
result = new ConnectionStatus(false, e);
|
|
||||||
}
|
}
|
||||||
catch (IOException ioe)
|
catch (IOException ioe)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue