[JENKINS-36240] Added GHRepository.getPermission(String).

This commit is contained in:
Jesse Glick
2016-12-16 18:02:28 -05:00
parent 0731f63237
commit ccb42d3249
4 changed files with 98 additions and 3 deletions

View File

@@ -598,11 +598,16 @@ class Requester {
InputStream es = wrapStream(uc.getErrorStream());
try {
if (es!=null) {
String error = IOUtils.toString(es, "UTF-8");
if (e instanceof FileNotFoundException) {
// pass through 404 Not Found to allow the caller to handle it intelligently
throw (IOException) new FileNotFoundException(IOUtils.toString(es, "UTF-8")).initCause(e);
} else
throw (IOException) new IOException(IOUtils.toString(es, "UTF-8")).initCause(e);
throw (IOException) new FileNotFoundException(error).initCause(e);
} else if (e instanceof HttpException) {
HttpException http = (HttpException) e;
throw (IOException) new HttpException(error, http.getResponseCode(), http.getResponseMessage(), http.getUrl(), e);
} else {
throw (IOException) new IOException(error).initCause(e);
}
} else
throw e;
} finally {