One Star

[resolved] send error code via tsendmail

Hi all
I wan to send the error code via a tsendmail componenet,but I don't know how to manage it .Someone says that if you press Ctrl and Space,you will get the list of variables,but in fact,it's seems no use.
Thank you for your suggestion in advance.A sample would be the best.
We are using TOS 4.1.1
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] send error code via tsendmail

Hello
The job looks like:
...
tLogCatcher--main-->tLogRow--main-->tJavaRow
|
onsubjobok
|
tSendMail
on tJavaRow:
globalMap.put("error_code", input_row.message);
on the message filed of tSendMail:
(String)globalMap.get("error_code")
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
24 REPLIES
Community Manager

Re: [resolved] send error code via tsendmail

Hello
What's error code you want to send on tSendmail? capture by tLogCatcher?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] send error code via tsendmail

Hi
Yes,I want to catch the exeception and send it to others mailbox via tsendmail. In addition,I also want to send the error java code ,is there a way to solve the problem?
Community Manager

Re: [resolved] send error code via tsendmail

Hello
The job looks like:
...
tLogCatcher--main-->tLogRow--main-->tJavaRow
|
onsubjobok
|
tSendMail
on tJavaRow:
globalMap.put("error_code", input_row.message);
on the message filed of tSendMail:
(String)globalMap.get("error_code")
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] send error code via tsendmail

Hello,
I read post about tlogcatcher, but i not able to use it.
I'd like to get all messages error or warning. for example i have this when i run job into talend
Unknown column 'Infinity' in 'field list'
Unknown column 'Infinity' in 'field list'
Unknown column 'Infinity' in 'field list'
Unknown column 'Infinity' in 'field list'
2011-01-26
i'd like to get errors when the job is running into a bat file. and then send a mail.
is it possible?
thanks
One Star

Re: [resolved] send error code via tsendmail

Thank you shong,it works.
Hi claudine,just try it as shong's method,you will get what you want.
One Star

Re: [resolved] send error code via tsendmail

Hi Joe,
you know what ? i could'nt put a "onsubjobok" because as it was test i use composant tfileoutputexcel instead of tsendmail. and it was impossible to connect 2 lines fromtLogCatcher.
thanks for your answer, sorry for my mistake!
Community Manager

Re: [resolved] send error code via tsendmail

Hi Claudine
Can you upload a screenshot of your job? What's your design problem?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] send error code via tsendmail

Hello Shong,
here is screen shot.
I don't know how to connect TlogCatcher.
the goal is to get all errors, even warning, in this example,
its a bat file running every night.
i divide by zero, so i get "message infinity..;" and the database is not updated.
in that case i'd like to have a mail
regards,
claudine
One Star

Re: [resolved] send error code via tsendmail

Hi shong
I have created a context and defined some global various in the context. Here is the problem: can I display the value of various I have defined in the mail sent via tsendmail? In other words,can I display the content of context in the mail sent via tsendmail?
One Star

Re: [resolved] send error code via tsendmail

Hello Joe,
i already do that
regards,
claudine
One Star

Re: [resolved] send error code via tsendmail

hello claudine
Have you tried to use a tDie or tWarn at the end of your job by OnSubjobError,and then use a tcatchlog to catch it ?
One Star

Re: [resolved] send error code via tsendmail

You're right, if i use a TDie, job will stop, and i can fetch message of tdie in mail.
I did'nt think about that before, thanks, i'll do that.
i'have to keep watch all bat jobs!
One Star

Re: [resolved] send error code via tsendmail

Is "chemin" the variable name that you have defined?
One Star

Re: [resolved] send error code via tsendmail

yes,
all the mail use context variable. except the sender
One Star

Re: [resolved] send error code via tsendmail

I'll have a try tomorrow,as the server is in busy working now. Thanks for your suggestion
One Star

Re: [resolved] send error code via tsendmail

hello,
i don't understand how to connect tLogCatcher,
why is it impossible to have a main line with a DbConnexion?
how this component works?
thanks
claudine
One Star

Re: [resolved] send error code via tsendmail

Hi,
I don't know java...
i tried the Shong solution with mail and i have those error, and realy not understand,
can you help?
thanks
One Star

Re: [resolved] send error code via tsendmail

Hi claudine,
I'm sorry that in fact, I don't know ,even alittle,about French. But , pls delete the ";"in your tsendmail first,it needn't.and then try it again.
One Star

Re: [resolved] send error code via tsendmail

About tlogCatcher, you needn't to connect it to any component but tLogRow. And you can use a tDie connect with your main job with OnComponentError/OnSubjobError.
The tLogCatcher will catch the exeception automatic.
One Star

Re: [resolved] send error code via tsendmail

Hi Joe,
I delete ; and i got error
One Star

Re: [resolved] send error code via tsendmail

For your answer for tLogcatcher, why in shong's example there is connexion. (main and on subjobok)

ps: i have to learn english and java!
One Star

Re: [resolved] send error code via tsendmail

Hi claudine,
I mean that you needn't to connect "tLogcatcher" to a DBconnection,as you said at #17.
I'm sorry that I can't get the error information exactly from your screenshot,as it's not in Engilsh.You'd better upload a screenshot of your whole job,and I think there maybe something wrong of architecture or basic settings.
Best regards
One Star

Re: [resolved] send error code via tsendmail

Hello Joe,
here is the code where i have error
i think it's a syntax error, if i cli ctrl+space after globalMap. i haven't the option of get.
if i do the same into tJava component, it's ok...
thanks
One Star

Re: [resolved] send error code via tsendmail

Hi,
I was designing a similar package.I have a issue
tLogCatcher--main-->tLogRow--main-->tJavaRow
|
onsubjobok
|
tSendMail
I used this flow but it sends 2 mails instead of one if there are multiple(2) errors.I need only only mail to come to my inbox.I guess tLogCatcher gets called whenever there is a error and not at the end to log all errors