Catmandu::Error(3pm)
π NAME π
Catmandu::Error β okay bestie, this is the Catmandu error hierarchy. It's giving structured exceptions, and it lives in the User Contributed Perl Documentation section (that's the 3pm part of Catmandu::Error(3pm), iykyk). π«Ά
β¨ SYNOPSIS β¨
use Catmandu::Sane;
sub be_naughty {
Catmandu::BadArg->throw("very naughty") if shift;
}
try {
be_naughty(1);
} catch_case [
'Catmandu::BadArg' => sub {
say "sorry";
}
];
Likeβ¦ look at her. You use Catmandu::Sane;, you write a little sub called be_naughty that does Catmandu::BadArg->throw("very naughty") if shift;, and then you wrap the whole thing in a try with a catch_case that matches 'Catmandu::BadArg' and runs a sub that just says "sorry". Iconic. No notes. π
π CURRRENT ERROR HIERARCHY π
(yes, that's spelled CURRRENT, she's a little extra, we love her)
Here's the whole fam, in order:
Throwable::ErrorCatmandu::ErrorCatmandu::BadValCatmandu::BadArgCatmandu::BadFixArgCatmandu::NotImplementedCatmandu::NoSuchPackageCatmandu::NoSuchFixPackageCatmandu::FixParseErrorCatmandu::FixErrorCatmandu::HTTPError
That's the entire lineup, no cap. π¦
πΈ SEE ALSO πΈ
Throwableβ go look at her, she's the blueprint fr fr π
And that's the page, bestie!! π This one came from perl v5.40.1, dated 2026-01-24, and it's part of the User Contributed Perl Documentation. Go throw some well-behaved errors, ily, bye!! β¨π«Άπ
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms