{
// decide what kind of error to throw
if (ep != null)
{
log.info(LogManager.getHeader(context, "sword_unable_to_set_user", "username=" + un));
throw new SwordAuthException("Unable to authenticate with the supplied credentials");
}
else
{
// FIXME: this shouldn't ever happen now, but may as well leave it in just in case
// there's a bug elsewhere
log.info(LogManager.getHeader(context, "sword_unable_to_set_on_behalf_of", "username=" + un + ",on_behalf_of=" + obo));
throw new SwordAuthException("Unable to authenticate the onBehalfOf account");
}
}
return sc;
}
catch (SQLException e)
{
log.error("caught exception: ", e);
throw new DSpaceSwordException("There was a problem accessing the repository user database", e);
}
catch (AuthorizeException e)
{
log.error("caught exception: ", e);
throw new SwordAuthException("There was a problem authenticating or authorising the user", e);
}
}