Hyper::Error - catch die and/or warn, offers throw method


Back to Top


NAME

Hyper::Error - catch die and/or warn, offers throw method

Back to Top


VERSION

This document describes Hyper::Error 0.02

Back to Top


SYNOPSIS

    use Hyper::Error fatal => 1, warn => 1;
    throw('error occured');

Back to Top


DESCRIPTION

Hyper::Error can catch fatal (die) and warn (warn) messages. The error output for shell scripts is plain text. Errors in Webserver context drop html messages. The error messages includes the callerstack, some codelines of last called package in Hyper namespace, some environment variables, and the original message. There is also a throw exported by default to throw errors.

Back to Top


SUBROUTINES/METHODS

import

    use Hyper::Error warn => 1, fatal => 1;

or more complex and without exported throw method

    require Hyper::Error;
    Hyper::Error->import(warn => 1, fatal => 1, throw => 0);

Adjust signal handlers for warn and/or die and exports the throw method.

_show_error_message

    Hyper::Error::_show_error_message(qw(
        error_message_of_line_1
         error_message_of_line_2
    ));

Print errormessage (html or plaintext).

_show_source

    Hyper::Error::_show_source($file_name, $line_number);

Get a code snippet for file, line.

throw

    use Hyper::Error;
    throw('my error');

or Hyper::Error throw => 0; Hyper::Error::throw('my error');

Used for throwing failures.

Back to Top


DIAGNOSTICS

Back to Top


CONFIGURATION AND ENVIRONMENT

Use the Hyper::Singleton::Context manpage for your configuration.

Sample for your Context.ini

    [Hyper::Error]
    html_template=Error/html_error.htc
    plain_template=Error/plain_error.htc

Back to Top


DEPENDENCIES

Back to Top


INCOMPATIBILITIES

Back to Top


BUGS AND LIMITATIONS

Back to Top


RCS INFORMATIONS

Last changed by

$Author: ac0v $

Id

$Id: Error.pm 522 2008-12-18 16:05:57Z ac0v $

Revision

$Revision: 522 $

Date

$Date: 2008-12-18 17:05:57 +0100 (Do, 18 Dez 2008) $

HeadURL

$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Error.pm $

Back to Top


AUTHOR

Andreas Specht <ACID@cpan.org>

Back to Top


LICENSE AND COPYRIGHT

Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Top

 Hyper::Error - catch die and/or warn, offers throw method