in reply to Catching error in DateTime::Format
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Catching error in DateTime::Format
by Anonymous Monk on Oct 27, 2025 at 18:47 UTC | |
by Corion (Patriarch) on Oct 27, 2025 at 19:14 UTC |