Merge pull request #203 from oisnot/feature/fetchrejectonaxioserror

Added reject with new Error if OpenVidu fetch fails
pull/204/head
Pablo Fuente Pérez 2019-02-19 12:02:22 +01:00 committed by GitHub
commit 18b8643cd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js // http.ClientRequest in node.js
console.error(error.request); console.error(error.request);
reject(new Error(error.request));
} else { } else {
// Something happened in setting up the request that triggered an Error // Something happened in setting up the request that triggered an Error
console.error('Error', error.message); console.error('Error', error.message);
reject(new Error(error.message));
} }
}); });
}); });
@ -705,4 +707,4 @@ export class OpenVidu {
return this.o.activeSessions; return this.o.activeSessions;
} }
} }