NAME

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

VERSION

This document describes Hyper::Error 0.02

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: 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 $

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.