catch errors in event handlers triggered by injection