catch errors in event handlers

refs #254