mirror of https://github.com/adamdruppe/arsd.git
catch usage error before segfault
This commit is contained in:
parent
668553d6a9
commit
c20375a8df
2
http2.d
2
http2.d
|
@ -966,6 +966,8 @@ class HttpRequest {
|
||||||
socket.connect(new UnixAddress(unixSocketPath));
|
socket.connect(new UnixAddress(unixSocketPath));
|
||||||
} else {
|
} else {
|
||||||
// FIXME: i should prolly do ipv6 if available too.
|
// FIXME: i should prolly do ipv6 if available too.
|
||||||
|
if(host.length == 0) // this could arguably also be an in contract since it is user error, but the exception is good enough
|
||||||
|
throw new Exception("No host given for request");
|
||||||
socket.connect(new InternetAddress(host, port));
|
socket.connect(new InternetAddress(host, port));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue