mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #9806 from pravdomil/patch-7
Fine-tune error messages in HTTP lib
This commit is contained in:
@@ -66,7 +66,7 @@ HTTP.call = function(method, url, options, callback) {
|
||||
if (options.auth) {
|
||||
var colonLoc = options.auth.indexOf(':');
|
||||
if (colonLoc < 0)
|
||||
throw new Error('auth option should be of the form "username:password"');
|
||||
throw new Error('Option auth should be of the form "username:password"');
|
||||
username = options.auth.substring(0, colonLoc);
|
||||
password = options.auth.substring(colonLoc+1);
|
||||
}
|
||||
@@ -136,10 +136,10 @@ HTTP.call = function(method, url, options, callback) {
|
||||
Meteor.clearTimeout(timer);
|
||||
|
||||
if (timed_out) {
|
||||
callback(new Error("timeout"));
|
||||
callback(new Error("Connection timeout"));
|
||||
} else if (! xhr.status) {
|
||||
// no HTTP response
|
||||
callback(new Error("network"));
|
||||
callback(new Error("Connection lost"));
|
||||
} else {
|
||||
|
||||
var response = {};
|
||||
|
||||
Reference in New Issue
Block a user