One Star

how to catch and log "For input string:

Hi,
I am trying to catch and log all errors into a table for the file process, but did not get it.
I use the tLogCatcher together with tDie and tWarn, and checked all of "Dir on error" checkbox of related tables.
I loaded a positional text into related tables. When I run it, I got an "For input string" error as below ( I created it on purpose).
connecting to socket on port 3462
connected
For input string: "01843235.4"
disconnected
But tLogCatcher did not catch it. How should I do to make this work ?
Thanks !
6 REPLIES
Community Manager

Re: how to catch and log "For input string:

Hi
This error is thrown on the file input component, so you need to check the 'die on error' option on the file input component such as tFileInputPositional that you are using.
Note that the job will throw out the java exception and stop if the 'die on error' option is checked, and tLogCatcher will catch the error.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: how to catch and log "For input string:

Yes, I could catch the error. But it is not what I expected.
What I expected is : just catch (actully log the error data) the error but let it continue to work like before(did not check the "die or error" check box.
Is there any to log the error data (for report and feedback purpose) instead of interrupt the process.
Thanks
Community Manager

Re: how to catch and log "For input string:

Hi
If the 'die on error' option is unchecked, the job will not thrown out the java exception and tLogCatcher can't catch the error, however, the problematic record will be output to the reject flow if you link a reject flow out of the component, for example:
tFileInputPositional---main---tMysqlOutput
---reject---tFileoutputDelimited
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: how to catch and log "For input string:

Yes, this is what exactly I wanted. Thanks a lot for your answers.
By the way, how could I login in with regiested name to this forum. I registed with my name and setup the user name and password. When I log in, it always redirect me to my profile. After I come back, it still displays "You are not logged in."
Thanks !
James
Seven Stars

Re: how to catch and log "For input string:

It works with Firefox but not with Internet Explorer. If you want to use IE, you need to go to Exchange and log in there and that should also log you in to the forum.
One Star

Re: how to catch and log "For input string:

OK, thanks !
My company only allows to use IE although I like the others such as Chrome and Firefox.
James