You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Greetings fellow Talendors!
I have a job that is exported as an autonomous job and is ran using a script. I want to be able to run the job without having an error/exception being reported to the Standard Error output, unless I manually send an Error.
I tried catching the exception with a tDie and tLogCatcher and output a simple string to std error, but the whole stack trace shows up.
Any help would be greatly appreciated!
Thanks!
Offline
Hi
It is Java throws the exception to the standard error output, uncheck the option 'die on error' and the component will capture the exception itself if you know which component throws the exception and it has the option 'die on error'.
Best regards
Shong
Offline

Ahh, I thought Talend was the one sending the stack trace out with the printStackTrace method. The component is a tFileInputDelimited, and I checked/unchecked the die on error option. I also attached a tDie to it. All 3 methods would not stop the stack trace of the file missing and not being able to be opened to the error output.
Offline
Hi
The option 'die on error' play a role in the row level, can't capture the FileNotFoundExeception. I think it is possible to capture the exception and stop reporting it to the standard error output, but the modification should on the entire studio architecture, not component level.
Best regards
Shong
Offline
Hi
I am very interesting in your solution, will you like to share it? Using tSystem to call the job script?
Best regards
Shong
Offline

We have java code executing the Talend script and it accepts an InputStream after execution of the job. The input stream reads for standardError, if the string is empty, we know the job ran good. If not, then we push the error to our gui. The issue was that the gui was showing the whole stack trace which is not good for our user. So my solution was this:
tLogCatcher (catches java exceptions) -> tJavaRow
the tJavaRow code is:
System.err.println("=-= " + input_row.message + "=-=);
Then, back in our code, I use StringUtils to parse errors that is wrapped with =-=
StringUtils.substringBetween(string, "=-=", "=-=);
This returns String[] with the errors that I can output cleanly.
Last edited by jkrfs (2011-09-15 04:21:34)
Offline
Pages: 1