You want to catch the exception by using eval in your test script, like it does in the original code:
my $bogus_datetime = eval { MyApp::Util->convert_datetime("FOO"); }; is ($bogus_datetime, undef, "convert_datetime doesn't blow up if sent +bogus date");
Update: I misread - I don't know how to suppress the output. What test module is t/Util.t using?
In reply to Re: Catching error in DateTime::Format
by Corion
in thread Catching error in DateTime::Format
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |