NAME

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

VERSION

This document describes Hyper::Error 0.01

SYNOPSIS

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

throw('error occured');

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.

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.

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

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

Sample for your Context.ini

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

DEPENDENCIES

  • version

  • autouse

  • Apache2::Log

  • Data::Dumper

  • HTML::Template::Compiled

  • File::Spec

  • English

  • Readonly

INCOMPATIBILITIES

BUGS AND LIMITATIONS

RCS INFORMATIONS

Last changed by

$Author: $

Id

$Id: $

Revision

$Revision: $

Date

$Date: $

HeadURL

$HeadURL: $

AUTHOR

Andreas Specht <ACID@cpan.org>

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.