Wraps rest client errors with custom exception