Skip to content

Commit

Permalink
Merge pull request #279 from apache/feature/268-UIMA-components-log-a…
Browse files Browse the repository at this point in the history
…nd-then-re-throw-exceptions-which-usually-leads-to-errors-being-logged-twice

Issue #268: UIMA components log and then re-throw exceptions which usually leads to errors being logged twice
  • Loading branch information
reckart committed Jan 12, 2023
2 parents 11f88d8 + 66e648d commit de4bde8
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,10 @@ protected void callAnalysisComponentProcess(CAS aCAS) throws AnalysisEngineProce
// log end of event
logger.logrb(Level.FINE, CLASS_NAME.getName(), "process", LOG_RESOURCE_BUNDLE,
"UIMA_analysis_engine_process_end__FINE", resourceName);
} catch (AnalysisEngineProcessException e) {
throw e;
} catch (Exception e) {
// log and rethrow exception
logger.log(Level.SEVERE, "", e);
if (e instanceof AnalysisEngineProcessException) {
throw (AnalysisEngineProcessException) e;
} else {
throw new AnalysisEngineProcessException(e);
}
throw new AnalysisEngineProcessException(e);
}
}

Expand Down

0 comments on commit de4bde8

Please sign in to comment.