You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to get the details of an empty repository, the github enterprise server returns an HTTP 409. This, in turn, causes Requester to throw an Error…
Caused by: java.io.IOException: Server returned HTTP response code: 409 for URL:
An Error, for those unfamiliar, is "a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." I don't think an HTTP 409 response warrants throwing an Error, thereby dooming the client Java process to exit with status code 1.
The text was updated successfully, but these errors were encountered:
Could we add something to repo for like isEmpty()? I see you can call getSize() and compare against 0, but I'm not sure if they would be absolutely guaranteed to be the same.
In the case where you get an 409 with error status Git Repository Is Empty shouldn't the iterator hasNext just return false?
I tried at first, repo.getSize == 0, but that had false positives. It seems like it rounds down in # of KB so projects with a few small files can still be 0.
So, now I'm experimenting with just not working with a repository if:
if (repo.getCreatedAt == repo.getPushedAt) {
// ignore repo
}
The fact that the github api doesn't help much to determine if a repo is empty and this issue makes it pretty hard to safely code a solution.
https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/Requester.java#L268
When attempting to get the details of an empty repository, the github enterprise server returns an HTTP 409. This, in turn, causes Requester to throw an Error…
Caused by: java.io.IOException: Server returned HTTP response code: 409 for URL:
An Error, for those unfamiliar, is "a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." I don't think an HTTP 409 response warrants throwing an Error, thereby dooming the client Java process to exit with status code 1.
The text was updated successfully, but these errors were encountered: