From 8158e9b25f0e81afdb044696520d5b0e2ffb03c8 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sat, 14 Sep 2013 20:43:20 -0700 Subject: [PATCH] fix for #310 --- dist/lib/swagger.js | 6 +++--- lib/swagger.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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) {