Skip to content

Commit

Permalink
reject connection failures in Session.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Sep 3, 2018
1 parent b2ec6a0 commit 0cddbbf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openvidu-node-client/src/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
});
Expand Down Expand Up @@ -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));
}
});
});
Expand Down Expand Up @@ -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));
}
});
});
Expand Down Expand Up @@ -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));
}
});
});
Expand Down Expand Up @@ -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));
}
});
});
Expand Down Expand Up @@ -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));
}
});
});
Expand Down

0 comments on commit 0cddbbf

Please sign in to comment.