details: https://code.openbravo.com/erp/devel/pi/rev/3fed28edc827 changeset: 33099:3fed28edc827 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Mon Dec 04 08:24:04 2017 +0100 summary: fixed bug 37435: unneeded log when exception thrown by DalBaseProcess
When an exception was thrown by a background DalBaseProcess, 2 traces were logged. Once with the stack trace of the actual excpetion, another one with a the stack trace of a new unrelated generated exception. Now DalBaseProcess just rethrows original exception instead of logging it and creating a new one, DefaultJob logs it with its stack trace, it also prints a readable process name. diffstat: src/org/openbravo/scheduling/DefaultJob.java | 4 +++- src/org/openbravo/service/db/DalBaseProcess.java | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diffs (28 lines): diff -r 21f7f8c56b57 -r 3fed28edc827 src/org/openbravo/scheduling/DefaultJob.java --- a/src/org/openbravo/scheduling/DefaultJob.java Sun Dec 03 00:20:53 2017 +0100 +++ b/src/org/openbravo/scheduling/DefaultJob.java Mon Dec 04 08:24:04 2017 +0100 @@ -63,7 +63,9 @@ processInstance.execute(bundle); } catch (final Exception e) { - log.error("Error executing process " + bundle.toString(), e); + String processName = bundle != null && bundle.getProcessClass() != null ? bundle + .getProcessClass().getName() : ""; + log.error("Error executing process " + processName, e); throw new JobExecutionException(e); } } diff -r 21f7f8c56b57 -r 3fed28edc827 src/org/openbravo/service/db/DalBaseProcess.java --- a/src/org/openbravo/service/db/DalBaseProcess.java Sun Dec 03 00:20:53 2017 +0100 +++ b/src/org/openbravo/service/db/DalBaseProcess.java Mon Dec 04 08:24:04 2017 +0100 @@ -84,9 +84,7 @@ } catch (Exception e) { errorOccured = true; - log.error("The process " + bundle.getProcessClass().getName() + " has thrown an exception. ", - e); - throw new Exception(e.getMessage()); + throw e; } finally { if (errorOccured) { if (bundle.getCloseConnection()) { ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits