In front-end JS, is there a way to catch errors globally?
For example, we might have:
const o = new Observable(o => {
o.error('unhandled error')
});
o.subscribe(v => console.log('this never happens')
so we have a 1 sub, and so the observable becomes active, but there is nobody to catch the error, is there a way to capture the error globally?