Catmandu::Error(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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::Error
  • Catmandu::Error
  • Catmandu::BadVal
  • Catmandu::BadArg
  • Catmandu::BadFixArg
  • Catmandu::NotImplemented
  • Catmandu::NoSuchPackage
  • Catmandu::NoSuchFixPackage
  • Catmandu::FixParseError
  • Catmandu::FixError
  • Catmandu::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