In the Java Server API, How Can I Trap a Permissions Error from a Work Item Save Operation?
I have a follow-up action that saves the work item. Sometimes this action will generate a permissions error. In those cases, I want the operation behavior to abort gracefully without interfering with the save operation. If the permissions error had been an exception, I could have caught it in a try-catch block. However, since a permissions error is something else, I'm not sure how to trap for that scenario and allow a graceful exit of the operation behavior.
Accepted answer
I should follow up on this post and provide some more details since I have the solution now. Ralph's answer set me on the correct path, but I just noticed this post in my search results and saw that the answer count was "0" which implied it was still unanswered.
Rather than catching a generic throwable exception, I ultimately found that I needed to catch "PermissionDeniedException". Catching this exception allowed me to continue the operation behavior without failing the save operation.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 04 '15, 8:41 a.m.Nate Decker
Aug 04 '15, 9:06 a.m.