You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This leads to a problem if statuspage API is unreachable (or any other error in TCP stack), which happened just last week - since error event isn't handled, it's propagated to the topmost process' scope. This leaves clients with 2 possibilities - handle error via process.on('unhandledException', () => {}) or crash.
In some (maybe most) cases handling such exceptions via process.on('unhandledException', () => {}) is undesirable due to difficulty of understanding where the error originated from etc.
There is a possibility to handle such errors with (now deprecated) domain package module internally, but given it's depreciation - it's not a great option either.
How to reproduce
constStatusPage=require('statuspage-api'),api=newStatusPage({pageid: 'id',apikey: 'key',host: 'someNonReachableHost.tld'});api.get('components',(result)=>{// Will never get called - global exception will occur.});
I'm happy to submit a patch to this.
The text was updated successfully, but these errors were encountered:
StatusPageAPI
class' methods createStatusPageRequest
, which emitserror
events, but those aren't handled in class' methods.This leads to a problem if statuspage API is unreachable (or any other error in TCP stack), which happened just last week - since
error
event isn't handled, it's propagated to the topmost process' scope. This leaves clients with 2 possibilities - handle error viaprocess.on('unhandledException', () => {})
or crash.In some (maybe most) cases handling such exceptions via
process.on('unhandledException', () => {})
is undesirable due to difficulty of understanding where the error originated from etc.There is a possibility to handle such errors with (now deprecated)
domain
package module internally, but given it's depreciation - it's not a great option either.How to reproduce
I'm happy to submit a patch to this.
The text was updated successfully, but these errors were encountered: