Razor2:...handler(3)

πŸ’– NAME πŸ’–

okay so bestie, this is the Razor2:...handler(3) page from User Contributed Perl Documentation ✨ and it's literally about Razor::Errorhandler - Error handling mechanism for Razor. periodt πŸ’…


✨ SYNOPSIS ✨

here's the whole vibe in code, no cap:

           package Foo;

           use Razor::Errorhandler;
           @ISA = qw(Razor::Errorhandler);

           sub alive {
               ..
               ..
               return
               $self->error ("Awake, awake! Ring the alarum bell! \
                              Murther and treason!", $dagger)
                   if $self->murdered($king);
           }

           package main;

           use Foo;
           my $foo = new Foo;
           $foo->alive($king) or print $foo->errstr();
           # prints "Awake, awake! ... "

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so Razor::Errorhandler encapsulates the error handling mechanism used by the modules in Razor bundle. it doesn't have a constructor and is meant to be inherited β€” no constructor main character energy here, just inheritance realness. the derived modules use its two methods, error() and errstr(), to communicate error messages to the caller. 🫢

when a method of the derived module fails, it calls $self->error() and returns to the caller. the error message passed to error() is made available to the caller through the errstr() accessor. error() also accepts a list of sensitive data that it wipes out (undef'es) before returning. πŸ”₯

bestie, listen: the caller should never call errstr() to check for errors. no cap. errstr() should be called only when a method indicates (usually through an undef return value) that an error has occured. this is because errstr() is never overwritten and will always contain a value after the occurance of first error. 😭

πŸ’… METHODS πŸ’…

error($mesage, ($wipeme, $wipemetoo))

the first argument to error() is $message β€” and yes, the signature says $mesage with one s, that's the original spelling, iykyk πŸ’€ β€” which is placed in $self->{errstr}, and the remaining arguments are interpretted as variables containing sensitive data that are wiped out from the memory. error() always returns undef. slay. ✨

errstr()

errstr() is an accessor method for $self->{errstr}. it's giving simple accessor, and honestly? iconic. πŸŽ€

πŸ‘‘ AUTHOR πŸ‘‘

Vipul Ved Prakash, <mail@vipul.net> β€” author behavior, periodt. 🌈

πŸ”₯ SEE ALSO πŸ”₯

  • Razor::Client(3) β€” go peek, bestie. 🫢

this page is from perl v5.44.0, dated 2026-10-17, and it's the Razor2:...handler(3) page β€” bye bestie, slay your error handling πŸ’…βœ¨

πŸ“¦ where this page comes from