Throwable::Error(3)

πŸ’– Throwable::Error β€” the manual, bestie πŸ’–

okay so this is the Throwable::Error(3) page, and it’s literally about an easy-to-use class for error objects. iykyk πŸ’…

🌸 NAME 🌸

Throwable::Error β€” an easy-to-use class for error objects. periodt.

✨ VERSION ✨

version 1.001 β€” that’s the version, bestie. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

  package MyApp::Error;
  # NOTE: Moo can also be used here instead of Moose
  use Moose;
  extends 'Throwable::Error';

  has execution_phase => (
    is  => 'ro',
    isa => 'MyApp::Phase',
    default => 'startup',
  );

...and in your app...

  MyApp::Error->throw("all communications offline");

  # or...

  MyApp::Error->throw({
    message         => "all communications offline",
    execution_phase => 'shutdown',
  });

🌈 DESCRIPTION 🌈

Throwable::Error is a base class for exceptions that will be thrown to signal errors and abort normal program flow. It’s an alternative to Exception::Class, and the features of Exception::Class are largely provided by the Moo object system atop which Throwable::Error is built. slay. ✨

Throwable::Error performs the Throwable and StackTrace::Auto roles. That means you can call throw on it to create and throw an error object in one call, and that every error object will have a stack trace for its creation. iconic behavior honestly 🫢

🐚 PERL VERSION 🐚

This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so like, don’t come for her minimum version unless you’re ready πŸ’€

πŸ‘‘ ATTRIBUTES πŸ‘‘

πŸŽ€ message

This attribute must be defined and must contain a string describing the error condition. This string will be printed at the top of the stack trace when the error is stringified. no cap. πŸ’…

🧚 stack_trace

This attribute, provided by StackTrace::Auto, will contain a stack trace object guaranteed to respond to the as_string method. For more information about the stack trace and associated behavior, consult the StackTrace::Auto docs. obsessed with a guaranteed as_string, honestly. πŸ¦‹

πŸ’… METHODS πŸ’…

⭐ as_string

This method will provide a string representing the error, containing the error’s message followed by its stack trace. cute, useful, and to the point. πŸŽ€

🫢 AUTHORS 🫢

  • Ricardo SIGNES <cpan@semiotic.systems>
  • Florian Ragwitz <rafl@debian.org>

This software is copyright (c) 2022 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ‘‘


okay bye bestie β€” this little page is from perl v5.42.0, dated 2023-01-03, and it’s the Throwable::Error(3) manpage. mwah! πŸ’‹πŸ’–

πŸ“¦ where this page comes from