Commit 0bdfa692 authored by michael.simon's avatar michael.simon
Browse files

Add catch for exception.

Best would be to move all exceptions to UnauthorizedExceptions. But
that's another story
closes #51
parent 5883d395
......@@ -35,6 +35,7 @@ import edu.kit.scc.webreg.dao.TextPropertyDao;
import edu.kit.scc.webreg.drools.UnauthorizedUser;
import edu.kit.scc.webreg.entity.TextPropertyEntity;
import edu.kit.scc.webreg.exc.GenericRestInterfaceException;
import edu.kit.scc.webreg.exc.LoginFailedException;
import edu.kit.scc.webreg.exc.NoRegistryFoundException;
import edu.kit.scc.webreg.exc.NoServiceFoundException;
import edu.kit.scc.webreg.exc.NoUserFoundException;
......@@ -155,6 +156,11 @@ public class AttributeQueryController {
for (UnauthorizedUser uu : e.getUnauthList()) {
addXmlError(response, uu.getMessage(), resolveString(uu.getMessage()));
return response;
catch (LoginFailedException e) {
generateFailXml(response, 405, "rules failed", e.getMessage());
return response;
catch (GenericRestInterfaceException e) {
generateFailXml(response, 500, "ecp login failed", "generic-error");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment