Error handler to reduce boilerplate.