Openbravo Issue Tracking System - Modules
View Issue Details
0038591ModulesExternal Data Integrationpublic2018-05-22 11:442018-11-16 07:50
javietxe 
AugustoMauch 
normalmajorhave not tried
newopen 
5
 
 
0038591: SERQA 197 Int: No error detail If NullPointerException happens in itemProcessor.processItem
If a NullPointerException happens in itemProcessor.processItem, the EDL is saved in error but there is not any detail of the error in the requestLine. This is because the error is saved doing e.getMessage() and in case of NullPointerException there is not message.
Implement an itemProcessor throwing a NullPointerException. No message will be stored in the RequestLine in error.
Store the whole exception. Being e the exception:

Instead of
saveFailedItem(item, e.getMessage());

Fix:

StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String error = sw.toString();
saveFailedItem(item, error);
No tags attached.
Issue History
2018-05-22 11:44javietxeNew Issue
2018-05-22 11:44javietxeAssigned To => platform
2018-05-22 11:44javietxeResolution time => 1528149600
2018-06-18 18:23hgbotCheckin
2018-06-18 18:23hgbotNote Added: 0105198
2018-06-18 18:23hgbotStatusnew => resolved
2018-06-18 18:23hgbotResolutionopen => fixed
2018-06-18 18:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.externaldata.integration/rev/e32866258863777e7844e870be26019e14d6148d [^]
2018-06-18 18:40AugustoMauchStatusresolved => new
2018-06-18 18:40AugustoMauchResolutionfixed => open
2018-06-18 18:40AugustoMauchNote Deleted: 0105198
2018-06-19 11:57AugustoMauchAssigned Toplatform => AugustoMauch
2018-07-04 10:28AugustoMauchResolution time1528149600 =>
2018-07-04 10:28AugustoMauchTypedefect => design defect
2018-07-04 10:29AugustoMauchNote Added: 0105569
2018-11-12 13:47javietxeNote Added: 0107851
2018-11-12 13:48javietxeNote Edited: 0107851bug_revision_view_page.php?bugnote_id=0107851#r17908

Notes
(0105569)
AugustoMauch   
2018-07-04 10:29   
Changed to design defect, because the fix is not clear. There are many cases where the exception captured is a checked exception, and showing the full stack trace would not help.
(0107851)
javietxe   
2018-11-12 13:47   
(edited on: 2018-11-12 13:48)
If the getMessage is not null, it is because the captured exception is not a checked exception. In these cases, it would help a lot having the stacktrace in order to debug the error.

Proposed solution:
if (e.getMessage() == null) {
   StringWriter sw = new StringWriter();
   PrintWriter pw = new PrintWriter(sw);
   e.printStackTrace(pw);
   String error = sw.toString();
   saveFailedItem(item, error);
} else {
   saveFailedItem(getBatchFromList(errorItem), e.getMessage());
}