Cataly...erface(3pm)

πŸ“¦
version 5.90132 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Catalyst::Exception::Interface β€” the vibe check for Catalyst exceptions πŸ’–

okay bestie, so this page is Cataly...erface(3pm) from the User Contributed Perl Documentation, and it's literally the role that defines the interface for Catalyst exceptions. yes, that role. the one that makes sure your exception class isn't out here doing its own thing. sit down, hydrate, we're learning 🫢


✨ NAME ✨

Catalyst::Exception::Interface β€” Role defining the interface for Catalyst exceptions.

like, it's a role. it defines an interface. for Catalyst exceptions. it's giving exactly what it says on the tin πŸ’…


🌸 SYNOPSIS 🌸

package My::Catalyst::Like::Exception;
use Moose;
use namespace::clean -except => 'meta';

with 'Catalyst::Exception::Interface';

# This comprises the required interface.
sub as_string { 'the exception text for stringification' }
sub throw { shift; die @_ }
sub rethrow { shift; die @_ }

okay so that comment in there? # This comprises the required interface. β€” that's not decorative, bestie. that's the whole entire point. those three subs are the required interface. that's it. that's the assignment. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

This is a role for the required interface for Catalyst exceptions.

It ensures that all exceptions follow the expected interface, and adds overloading for stringification when composed onto a class.

so real talk: this role is the group chat admin. it keeps everybody on the same page. if you compose it onto your class, it (1) makes sure your exceptions stick to the expected interface, and (2) adds overloading for stringification. so when your exception gets stringified, it knows what to do instead of just... sitting there. iconic behaviour, no cap πŸ‘‘


πŸŽ€ REQUIRED METHODS πŸŽ€

you literally must have these. no skipping. no "i'll add it later." it's giving syllabus day and attendance is mandatory.

as_string

throw

rethrow

yes that's the entire list, that's the whole section, and yes they're all required. periodt πŸ’…


πŸ”₯ METHODS πŸ”₯

meta

Provided by Moose.

it's not yours, it's not mine, it's Moose's. Moose handed it to you. say thank you. πŸ’œ


🌈 SEE ALSO 🌈

  • Catalyst
  • Catalyst::Exception

go read those too, bestie, iykyk πŸ“š


πŸ’€ AUTHORS πŸ’€

Catalyst Contributors, see Catalyst.pm.

not a single name, not even a "me". just the collective. the group chat wrote this. we all did. 🫢


This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

free as in freedom, free as in "go ahead bestie, remix it", under the same terms as Perl itself. slay. πŸ’–


ngl this page is short but it ate. tiny role, huge responsibility. don't skip the required methods or the vibe check will find you 😭

and that's the whole page, babes β€” this was Cataly...erface(3pm) from perl v5.40.0, dated 2024-11-15, and yes the header/footer truncation is just the manpage doing its little thing 🌸 bye bye, go write your exception class correctly πŸ’…βœ¨

πŸ“¦ where this page comes from