Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

jkrfs
2011-09-15 04:21:15

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.

shong
2011-09-15 04:04:44

Hi
I am very interesting in your solution, will you like to share it? Using tSystem to call the job script?

Best regards
Shong

jkrfs
2011-09-15 03:48:41

Thats fine, I found an intermediary solution that works for now.

Thanks

shong
2011-09-15 03:45:16

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

jkrfs
2011-09-15 03:23:32

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.

shong
2011-09-15 03:21:11

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

jkrfs
2011-09-15 00:21:06

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!

Board footer

Powered by FluxBB