Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Call getNextException in talend

Hi,
Does anyone know how to call the getNextException in talend jobs to see the actual error message?
Regards
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Unfortunately Talend has decided not to do this in its code generator. Thats because we have to help our self.
I assume you have a t<anydb>Output component.
Use the flow Main and extend the flow to a tJavaFlex.
.... tOracleOutput --main--> tJavaFlex
The tJavaFlex has 3 code parts: Begin (here we will add some code), Main (will remain empty) and End (here we will add some code)
For the Begin part:
try {

For the End part:
} catch (Exception e) {
if (e instanceof java.sql.SQLException) {
java.sql.SQLException ne = ((java.sql.SQLException) e).getNextException();
if (ne != null) {
throw new Exception(e.getMessage() + ", next:" + ne.getMessage(), e);
} else {
throw e;
}
} else {
throw e;
}
}