From 0cddbbf745e1496e5c3be4f37430d52a249dc8b8 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 3 Sep 2018 09:54:21 +0200 Subject: [PATCH] reject connection failures in Session.ts --- openvidu-node-client/src/Session.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index 12cd7e013c..fff88a6b4c 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -127,9 +127,11 @@ export class Session { // `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)); } }); }); @@ -170,9 +172,11 @@ export class Session { // `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)); } }); }); @@ -218,9 +222,11 @@ export class Session { // `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)); } }); }); @@ -285,9 +291,11 @@ export class Session { // `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)); } }); }); @@ -338,9 +346,11 @@ export class Session { // `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,9 +408,11 @@ export class Session { // `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)); } }); });