diff --git a/client.js b/client.js index bd10271..7d0d567 100644 --- a/client.js +++ b/client.js @@ -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;