Ryu::Exception(3)

πŸ“¦ version 4.001, in alpine 3.24

πŸ’– NAME πŸ’–

Bestie, this is Ryu::Exception(3) β€” straight from the User Contributed Perl Documentation shelf, and it's all about support for Future-style failure information. That's the vibe: exception info that knows how to hang with Future. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

use Ryu::Exception;
my $exception = Ryu::Exception->new(
 type    => 'http',
 message => '404 response'
 details => [ $response, $request ]
);
Future->fail($exception->failure);

🌸 DESCRIPTION 🌸

Okay so this is a generic exceptions interface, and it implements the 3-part failure codes as described in Future. No cap. 🫢

πŸŽ€ new πŸŽ€

Instantiate from named parameters. That's it, that's the whole thing πŸ’…

πŸ’… throw πŸ’…

Throws this exception. Like, actually throws it:

$exception->throw;

πŸ‘‘ type πŸ‘‘

Returns the type, which should be a string such as "http". So the type is a string, and "http" is the example. Slay. 🌈

🌈 message 🌈

Returns the message, which is a freeform string. Freeform, bestie β€” it's giving freedom. πŸ¦‹

πŸ“ details πŸ“

Returns the list of details. The specifics of those details are specific to the type. So yes: details list, type-specific specifics. Periodt. πŸ’–

πŸ”₯ fail πŸ”₯

Fails the given Future with this exception. Very main character energy for a failure, honestly. 😭

⭐ as_future ⭐

Returns a failed Future containing the message, type and details from this exception. Iconic little wrapper. πŸŽ€

🧚 from_future 🧚

Extracts failure information from a Future and instantiates accordingly. Reverse uno card, but for exceptions. 🫢

πŸ’œ AUTHOR πŸ’œ

Tom Molesworth <TEAM@cpan.org> β€” we love a credited icon πŸ‘‘

πŸŽ€ LICENSE πŸŽ€

Copyright Tom Molesworth 2011-2024. Licensed under the same terms as Perl itself. πŸ’–


And that's the whole page, bestie β€” signing off with perl v5.42.2, dated 2026-02-15, for Ryu::Exception(3) βœ¨πŸ’…

πŸ“¦ where this page comes from