Catch errors raised in handlers.