Added reject with new Error if OpenVidu fetch fails because of network problems.

pull/203/head
Øistein Notnæs 2019-02-19 10:48:39 +01:00
parent d727b3bc7f
commit 0379d288db
1 changed files with 3 additions and 1 deletions

View File

@ -483,9 +483,11 @@ export class OpenVidu {
// `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));
}
});
});