Surround NotAuthorizedException with try catch in the force-methods of TaskService #2162

This commit is contained in:
Luis Rivas 2023-03-21 20:24:03 -05:00 committed by Alex
parent 9d04449779
commit 7fdbaccae0
1 changed files with 8 additions and 2 deletions

View File

@ -236,8 +236,14 @@ public interface TaskService {
Task forceCancelClaim(String taskId) Task forceCancelClaim(String taskId)
throws TaskNotFoundException, throws TaskNotFoundException,
InvalidOwnerException, InvalidOwnerException,
NotAuthorizedOnWorkbasketException, InvalidTaskStateException {
InvalidTaskStateException; try {
return this.cancelClaim(taskId, true);
} catch (NotAuthorizedOnWorkbasketException e) {
throw new SystemException(
"this should not have happened. You've discovered a new bug! :D", e);
}
}
/** /**
* Request review for an existing {@linkplain Task} that is in {@linkplain TaskState#CLAIMED}. * Request review for an existing {@linkplain Task} that is in {@linkplain TaskState#CLAIMED}.