error handler for transport and non-http errors