diff --git a/dist/lib/swagger.js b/dist/lib/swagger.js index 9e7fb507..d2351a45 100644 --- a/dist/lib/swagger.js +++ b/dist/lib/swagger.js @@ -55,12 +55,12 @@ error: function(response) { if (_this.url.substring(0, 4) !== 'http') { return _this.fail('Please specify the protocol for ' + _this.url); - } else if (error.status === 0) { + } else if (response.status === 0) { return _this.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.'); - } else if (error.status === 404) { + } else if (response.status === 404) { return _this.fail('Can\'t read swagger JSON from ' + _this.url); } else { - return _this.fail(error.status + ' : ' + error.statusText + ' ' + _this.url); + return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url); } }, response: function(rawResponse) { diff --git a/lib/swagger.js b/lib/swagger.js index 9e7fb507..d2351a45 100644 --- a/lib/swagger.js +++ b/lib/swagger.js @@ -55,12 +55,12 @@ error: function(response) { if (_this.url.substring(0, 4) !== 'http') { return _this.fail('Please specify the protocol for ' + _this.url); - } else if (error.status === 0) { + } else if (response.status === 0) { return _this.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.'); - } else if (error.status === 404) { + } else if (response.status === 404) { return _this.fail('Can\'t read swagger JSON from ' + _this.url); } else { - return _this.fail(error.status + ' : ' + error.statusText + ' ' + _this.url); + return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url); } }, response: function(rawResponse) {