When I call send on a Mail::Builder::Simple object, the program dies and dumps a string with a string saying something to the effect of no SMTP server, and a trace dump. OK, now I know this function indicates failure by throwing an exception.
So I write:
And I get, no matter how I look at it, an empty string for $@ that tests as true. Where did my huge error message go? If it's an object, I expect it to show a ref and stringify when interpolated.my $mailer = new Mail::Builder::Simple::; eval { $mailer->send ( mail_client => { mailer => 'SMTP' }, to => 'john@dlugosz.com', from => $form->param_value('email'), subject => "[Contact Form]" . $form->param_value('subject'), plaintext => $form->param_value('message') ) }; if ($@) { my $err= $@; $c->log->info("what is this?" . ref($err)); $c->log->error("return value from email is:\n $err"); $c->stash->{form_error}= "$err"; } else { $c->stash->{form_sent}= 1; }
Where did the error info go?
In reply to Where did $@ go? by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |