Fix error handling on remote http failure