Handle HTTP errors.