handle errors from localtunnel server when requesting initial url

This commit is contained in:
Roman Shtylman
2014-04-19 19:30:44 -04:00
parent 92bb807908
commit 3d54de851f

View File

@@ -199,6 +199,11 @@ Tunnel.prototype._init = function(cb) {
return setTimeout(get_url, 1000);
}
if (res.status !== 200) {
var err = new Error((body && body.message) || 'localtunnel server returned an error, please try again');
return cb(err);
}
var port = body.port;
var host = upstream.hostname;