anchor.diff:          }
         }
       });
  -    xhr.onError.listen((_) => completer.completeError(new HttpResult.fromXhr(xhr)));
  +    xhr.onError.listen((_) => completer.completeError(HttpGitException.fromXhr(xhr)));
       String bodySize = (body.size / 1024).toStringAsFixed(2);
       xhr.upload.onProgress.listen((event) {
         // TODO add progress.
  
positive.code:         return parser.parse(buffer, store, packProgress).then(
              (PackParseResult obj) {
             completer.complete(obj);
          });
        }
      });
  
      xhr.onError.listen((_) {
        completer.completeError(new HttpResult.fromXhr(xhr));
      });
  
      xhr.onAbort.listen((_) {
        completer.completeError(new HttpResult.fromXhr(xhr));
      });
  
      xhr.send(body);
  
negative.code:   }
  }
  
  class HttpGitException extends GitException {
    int status;
    String statusText;
  
    HttpGitException(this.status, this.statusText, [String errorCode,
        String message, bool canIgnore]) : super(errorCode, message, canIgnore);
  
    static fromXhr(HttpRequest request) {
      String errorCode;
  
      if (request.status == 401) {
        errorCode = GitErrorConstants.GIT_AUTH_ERROR;
      } else if (request.status == 404) {
          errorCode = GitErrorConstants.GIT_HTTP_404_ERROR;
      } else {
        errorCode = GitErrorConstants.GIT_HTTP_ERROR;
      }
  
      return new HttpGitException(request.status, request.statusText, errorCode,
          "", false);
    }
  
    /**
     * Returns `true` if the status is 401 Unauthorized.
  