Catch errors in the event manager

Just in case something goes horribly wrong