Commit 54fecd19 authored by rswindell's avatar rswindell
Browse files

Improve the details of the "Unable to connect" error exception.

parent 96f0826a
......@@ -109,9 +109,10 @@ HTTPRequest.prototype.SendRequest=function() {
this.sock.close();
if((this.sock=new Socket(SOCK_STREAM))==null)
throw("Unable to create socket");
if(!this.sock.connect(this.url.host, this.url.port?this.url.port:(this.url.scheme=='http'?80:443))) {
var port = this.url.port?this.url.port:(this.url.scheme=='http'?80:443);
if(!this.sock.connect(this.url.host, port)) {
this.sock.close();
throw("Unable to connect");
throw(format("Unable to connect to %s:%u", this.url.host, this.url.port));
}
if(this.url.scheme=='https')
this.sock.ssl_session=true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment