fixed warning in finally instead of catch
This commit is contained in:
parent
43631206b3
commit
e64f88d768
|
@ -82,11 +82,13 @@ public class GCubeHookSiteRoleLocalService extends UserGroupRoleLocalServiceWrap
|
||||||
else
|
else
|
||||||
vreFolderManager.removeAdmin(theUserToPromoteOrDeclass);
|
vreFolderManager.removeAdmin(theUserToPromoteOrDeclass);
|
||||||
_log.info("*VREFolder-Hook** add/remove role operation complete");
|
_log.info("*VREFolder-Hook** add/remove role operation complete");
|
||||||
}
|
|
||||||
finally {
|
} catch (Exception e) {
|
||||||
|
_log.error("An error occurred (or the user was already Admin) when trying to update shub role of userId "+ userId + " to the groupId: " + groupId, e);
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
AccessTokenProvider.instance.set(previousUMAToken);
|
AccessTokenProvider.instance.set(previousUMAToken);
|
||||||
SecurityTokenProvider.instance.set(previousToken);
|
SecurityTokenProvider.instance.set(previousToken);
|
||||||
_log.warn("An error occurred (or the user was already Admin) when trying to update shub role of userId "+ userId + " to the groupId: " + groupId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,10 +161,12 @@ public class GCubeHookUserLocalService extends UserLocalServiceWrapper {
|
||||||
client.addUserToGroup(username2Add,vreFolderNameForsHub);
|
client.addUserToGroup(username2Add,vreFolderNameForsHub);
|
||||||
else
|
else
|
||||||
client.removeUserFromGroup(username2Add, vreFolderNameForsHub);
|
client.removeUserFromGroup(username2Add, vreFolderNameForsHub);
|
||||||
|
} catch (Exception e) {
|
||||||
|
_log.error("An error occurred (or the user was already member) when trying to remove or add the user "+ username2Add + " to the VRE context: " + context, e);
|
||||||
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
AccessTokenProvider.instance.set(previousUMAToken);
|
AccessTokenProvider.instance.set(previousUMAToken);
|
||||||
SecurityTokenProvider.instance.set(previousToken);
|
SecurityTokenProvider.instance.set(previousToken);
|
||||||
_log.warn("An error occurred (or the user was already member) when trying to remove or add the user "+ username2Add + " to the VRE context: " + context);
|
|
||||||
}
|
}
|
||||||
_log.info("*VREFolder-Hook** " + username2Add + " was added or removed succefully from this VRE Folder. Added? (if false was removed)" + add);
|
_log.info("*VREFolder-Hook** " + username2Add + " was added or removed succefully from this VRE Folder. Added? (if false was removed)" + add);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue