Skip to content

Commit

Permalink
Clear context in a finally block
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Jul 10, 2024
1 parent aaba063 commit eec8b96
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
try {
threadPool.getThreadContext().setExecutionContext(plugin.getClass().getName());
result = m.invoke(restHandler, args);
threadPool.getThreadContext().clearExecutionContext();
} catch (InvocationTargetException e) {
throw e.getTargetException();
} catch (Exception e) {
throw new RuntimeException("unexpected invocation exception: " + e.getMessage());
} finally {
threadPool.getThreadContext().clearExecutionContext();
}
return result;
}
Expand Down

0 comments on commit eec8b96

Please sign in to comment.