Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038591
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Modules] External Data Integrationmajorhave not tried2018-05-22 11:442018-11-16 07:50
ReporterjavietxeView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revisione32866258863
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0038591: SERQA 197 Int: No error detail If NullPointerException happens in itemProcessor.processItem

DescriptionIf 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.
Steps To ReproduceImplement an itemProcessor throwing a NullPointerException. No message will be stored in the RequestLine in error.
Proposed SolutionStore 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);
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0105569)
AugustoMauch (manager)
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 (developer)
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());
}


- Issue History
Date Modified Username Field Change
2018-05-22 11:44 javietxe New Issue
2018-05-22 11:44 javietxe Assigned To => platform
2018-05-22 11:44 javietxe Resolution time => 1528149600
2018-06-18 18:23 hgbot Checkin
2018-06-18 18:23 hgbot Note Added: 0105198
2018-06-18 18:23 hgbot Status new => resolved
2018-06-18 18:23 hgbot Resolution open => fixed
2018-06-18 18:23 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.externaldata.integration/rev/e32866258863777e7844e870be26019e14d6148d [^]
2018-06-18 18:40 AugustoMauch Status resolved => new
2018-06-18 18:40 AugustoMauch Resolution fixed => open
2018-06-18 18:40 AugustoMauch Note Deleted: 0105198
2018-06-19 11:57 AugustoMauch Assigned To platform => AugustoMauch
2018-07-04 10:28 AugustoMauch Resolution time 1528149600 =>
2018-07-04 10:28 AugustoMauch Type defect => design defect
2018-07-04 10:29 AugustoMauch Note Added: 0105569
2018-11-12 13:47 javietxe Note Added: 0107851
2018-11-12 13:48 javietxe Note Edited: 0107851 View Revisions


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker