Name

Unexpected::TraitFor::ErrorLeader - Prepends a leader to the exception

Synopsis

package MyException;

use Moose;

extends 'Unexpected';
with    'Unexpected::TraitFor::ErrorLeader';

Version

This documents version v0.1.$Rev: 8 $ of Unexpected::TraitFor::ErrorLeader

Description

Prepends a one line stack summary to the exception error message

Configuration and Environment

Requires the as_string method in the consuming class, as well as filtered_frames from the stack trace role

The Unexpected->Ignore class attribute is an array ref of methods whose presence should be ignored by the error message leader. It does the 'Array' trait where push implements the ignore_class method. Defaults to an empty array ref

Defines the following attributes;

leader

Set to the package and line number where the error should be reported

level

A positive integer which defaults to one. How many additional stack frames to pop before calculating the leader attribute

Modifies as_string in the consuming class. Prepends the leader attribute to the return value

Subroutines/Methods

None

Diagnostics

None

Dependencies

namespace::autoclean
List::Util
Moose::Role
MooseX::ClassAttribute
MooseX::Types::Common

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2013 Peter Flanigan. All rights reserved

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

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE