Pandoc::Error(3pm)

πŸ“¦
version 0.9.2 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Pandoc::Error πŸ’–

okay bestie, so this is Pandoc::Error β€” it's the class that handles Pandoc document processing errors 🫢. It lives in the User Contributed Perl Documentation corner of the world, and honestly? It's giving "quietly holding the whole error-handling situation together" energy. πŸ‘‘


✨ SYNOPSIS ✨

Here's the vibe, in actual code, copied exactly, no notes:

use Try::Tiny;

try {
    ...
} catch {
    if ( blessed $_ && $_->isa('Pandoc::Error') ) {
        ...
    }
};

Like… you wrap the risky stuff in try, and in catch you go "hmm, is this actually a Pandoc::Error?" with blessed $_ and $_->isa('Pandoc::Error'), and then you do your lil ... thing. 🌸


πŸŽ€ METHODS πŸŽ€

throw( [ %fields ] )

Throw an existing error, or create a brand new error and throw that one. πŸ”₯

Setting the field message is recommended β€” like, do it, bestie, it's the whole point. The message also gets enriched with the error location, so it's not just floating there with no context. πŸ’…

And if you want a stack trace, you can add one with $Carp::Verbose or Carp::Always. No cap. πŸ‘€

message

This is the error message itself. It's also what you get back when the thing gets stringified. So yeah, it's the main character twice. ⭐


🌈 SEE ALSO 🌈

Big important tea β˜•: this class does not inherit from Throwable, Exception::Class or Class::Exception β€” but it may do so in a future version. So like, don't build your whole personality around its current parentage, iykyk. πŸ™ˆ


and that's the whole page, bestie, you ate πŸ’–βœ¨

this lil writeup came from Pandoc::Error(3pm), part of the User Contributed Perl Documentation, and the footer said perl v5.38.2 with a date of 2024-08-03 πŸ¦‹ β€” so if future-you is reading this, hi, check if anything changed, love u, bye πŸ’œ

πŸ“¦ where this page comes from