feat(core): allow custom local scripts to trigger on uncaught exceptions #6586