I need to handle browser specific error "Message manager disconnected". The error seems to be general type “Error” so the only way (I can think of) to distinguish it is to check if:
if (err.message === 'Message manager disconnected')
But is this a good idea? Is it likely that the error message would change in the future or that it’s different on different build (translated maybe?).
Maybe there is something in err.stack that can help? In any case, I guess it’s never going to be guaranteed to be a stable test forever but at least with a stack frame it’s definitely not going to vary across translated locales (although the error message probably won’t be either).