pull out common error handling code, and better message when a subscription handler fails