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
Loading
Loading
Loading
Loading
+29 −26
Original line number Diff line number Diff line
@@ -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