From 85b651cc02627160c2b7a7d032e7eafad9a791e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20S=C3=A1?= Date: Wed, 9 Jun 2021 16:22:55 +0100 Subject: [PATCH 1/3] remove console.error poluting console output --- openvidu-node-client/src/Session.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index 7a2fa28d..79d70843 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -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)); } } From ae1c760af006e545cf7df9f8ecba1c87a8b4a0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20S=C3=A1?= Date: Wed, 9 Jun 2021 16:46:39 +0100 Subject: [PATCH 2/3] replace console.error with just reject --- openvidu-node-client/src/OpenVidu.ts | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/openvidu-node-client/src/OpenVidu.ts b/openvidu-node-client/src/OpenVidu.ts index 672786f9..b9f6b7c7 100644 --- a/openvidu-node-client/src/OpenVidu.ts +++ b/openvidu-node-client/src/OpenVidu.ts @@ -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,11 @@ 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)); reject(error); } else { // Something happened in setting up the request that triggered an Error - console.error('Error', error.message); + reject(new Error(error.message)); reject(new Error(error.message)); } }); @@ -649,10 +649,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 +668,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; From 2148b379741fae873b423e3fe71b461e26c49dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20S=C3=A1?= Date: Wed, 9 Jun 2021 16:49:52 +0100 Subject: [PATCH 3/3] removed double reject() call from search&replace --- openvidu-node-client/src/OpenVidu.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/openvidu-node-client/src/OpenVidu.ts b/openvidu-node-client/src/OpenVidu.ts index b9f6b7c7..b29aaad5 100644 --- a/openvidu-node-client/src/OpenVidu.ts +++ b/openvidu-node-client/src/OpenVidu.ts @@ -479,12 +479,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 - reject(new Error(error.request)); reject(error); } else { // Something happened in setting up the request that triggered an Error reject(new Error(error.message)); - reject(new Error(error.message)); } }); });