fix for #310
This commit is contained in:
6
dist/lib/swagger.js
vendored
6
dist/lib/swagger.js
vendored
@@ -55,12 +55,12 @@
|
|||||||
error: function(response) {
|
error: function(response) {
|
||||||
if (_this.url.substring(0, 4) !== 'http') {
|
if (_this.url.substring(0, 4) !== 'http') {
|
||||||
return _this.fail('Please specify the protocol for ' + _this.url);
|
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.');
|
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);
|
return _this.fail('Can\'t read swagger JSON from ' + _this.url);
|
||||||
} else {
|
} else {
|
||||||
return _this.fail(error.status + ' : ' + error.statusText + ' ' + _this.url);
|
return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
response: function(rawResponse) {
|
response: function(rawResponse) {
|
||||||
|
|||||||
@@ -55,12 +55,12 @@
|
|||||||
error: function(response) {
|
error: function(response) {
|
||||||
if (_this.url.substring(0, 4) !== 'http') {
|
if (_this.url.substring(0, 4) !== 'http') {
|
||||||
return _this.fail('Please specify the protocol for ' + _this.url);
|
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.');
|
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);
|
return _this.fail('Can\'t read swagger JSON from ' + _this.url);
|
||||||
} else {
|
} else {
|
||||||
return _this.fail(error.status + ' : ' + error.statusText + ' ' + _this.url);
|
return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
response: function(rawResponse) {
|
response: function(rawResponse) {
|
||||||
|
|||||||
Reference in New Issue
Block a user