Skip to content
Snippets Groups Projects
Commit 76c58f63 authored by Brian Major's avatar Brian Major
Browse files

ac2 - no exception throw on augment subject if user not found

parent 2153cec0
Branches
Tags
No related merge requests found
......@@ -148,7 +148,21 @@ public class UserClient
HttpDownload download = new HttpDownload(url, out);
download.run();
this.handleThrowable(download);
int responseCode = download.getResponseCode();
if (responseCode == 404) // not found
{
return;
}
if (responseCode != 200)
{
String message = "Error calling /ac to augment subject";
if (download.getThrowable() != null)
{
throw new IllegalStateException(message, download.getThrowable());
}
throw new IllegalStateException(message);
}
subject.getPrincipals().clear();
subject.getPrincipals().addAll(this.getPrincipals(out));
}
......@@ -192,17 +206,6 @@ public class UserClient
}
}
protected void handleThrowable(HttpDownload download)
{
Throwable throwable = download.getThrowable();
if (throwable != null)
{
log.debug("handleThrowable(): throwable (" + download
.getResponseCode() + ")", throwable);
throw new IllegalStateException(throwable.getMessage());
}
}
protected URL getURL(Principal principal)
{
try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment