GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Throwable::Error(3) User Contributed Perl Documentation Throwable::Error(3)

Throwable::Error - an easy-to-use class for error objects

version 1.000

  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',
  });

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

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.

This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago.

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.

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.

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.

This method will provide a string representing the error, containing the error's message followed by the its stack trace.

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

This software is copyright (c) 2021 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.

2021-06-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.