Merge pull request #630 from pedro-sa-89/remove-console.error-poluting-console-output

removed console.error() poluting console output on http failure
pull/634/head
Carlos Santos 2021-06-10 11:39:29 +02:00 committed by GitHub
commit 131d883299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 19 deletions

View File

@ -206,10 +206,10 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(error.request);
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(error.message);
}
});
});
@ -259,10 +259,10 @@ export class OpenVidu {
} else if (error.request) {
// The request was made but no response was received `error.request` is an instance of XMLHttpRequest
// in the browser and an instance of http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
});
@ -304,10 +304,10 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
});
@ -352,10 +352,10 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
});
@ -398,10 +398,10 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
});
@ -479,11 +479,9 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(error);
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
@ -649,10 +647,10 @@ export class OpenVidu {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
});
@ -668,7 +666,6 @@ export class OpenVidu {
try {
url = new URL(this.hostname);
} catch (error) {
console.error('URL format incorrect', error);
throw new Error('URL format incorrect: ' + error);
}
this.host = url.protocol + '//' + url.host;

View File

@ -511,11 +511,9 @@ export class Session {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
});
@ -642,11 +640,9 @@ export class Session {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error(error.request);
reject(new Error(error.request));
} else {
// Something happened in setting up the request that triggered an Error
console.error('Error', error.message);
reject(new Error(error.message));
}
}