NAME

Error::Pure::ANSIColor::Die - Error::Pure module with classic die.

SYNOPSIS

use Error::Pure::ANSIColor::Die qw(err);

err 'This is a fatal error', 'name', 'value';

# __or__

use Error::Pure qw(err);

$ENV{'ERROR_PURE_TYPE'} = 'ANSIColor::Die';

err "This is a fatal error.", "name", "value";

SUBROUTINES

err

err 'This is a fatal error', 'name', 'value';

Process error with messages (error, error_key/value pairs).

EXAMPLE1

use strict;
use warnings;

use Error::Pure::ANSIColor::Die qw(err);

# Error.
err '1';

# Output:
# 1 at ../err_via_ansicolor_die.pl line 9.

EXAMPLE2

use strict;
use warnings;

use Error::Pure::ANSIColor::Die qw(err);

# Error.
err '1', '2', '3';

# Output:
# 123 at ../err_via_ansicolor_die_with_params.pl line 9.

EXAMPLE3

use strict;
use warnings;

use Dumpvalue;
use Error::Pure::ANSIColor::Die qw(err);
use Error::Pure::Utils qw(err_get);

# Error in eval.
eval { err '1', '2', '3'; };

# Error structure.
my @err = err_get();

# Dump.
my $dump = Dumpvalue->new;
$dump->dumpValues(@err);

# In @err:
# [
#         {
#                 'msg' => [
#                         '1',
#                         '2',
#                         '3',
#                 ],
#                 'stack' => [
#                         {
#                                 'args' => '(1)',
#                                 'class' => 'main',
#                                 'line' => '9',
#                                 'prog' => 'err_via_ansicolor_die_with_params_in_eval_and_dump.pl',
#                                 'sub' => 'err',
#                         },
#                         {
#                                 'args' => '',
#                                 'class' => 'main',
#                                 'line' => '9',
#                                 'prog' => 'err_via_ansicolor_die_with_params_in_eval_and_dump.pl',
#                                 'sub' => 'eval {...}',
#                         },
#                 ],
#         },
# ],

DEPENDENCIES

Error::Pure::Output::ANSIColor, Error::Pure::Utils, Exporter, List::Util, Readonly.

SEE ALSO

Task::Error::Pure

Install the Error::Pure modules.

REPOSITORY

https://github.com/michal-josef-spacek/Error-Pure-ANSIColor

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2013-2022 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.29