View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Peter Flanigan > Unexpected > Unexpected::TraitFor::ErrorLeader



Annotate this POD



Open  0
View/Report Bugs
Module Version: v1.0.1   Source  

Name ^

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

Synopsis ^

   package MyException;

   use Moo;

   extends 'Unexpected';
   with    '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, the clone method from the Throwing role, as well as frames from the stack trace role

Defines the following attributes;


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


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 ^


   $array_ref = $self->ignore;

Read only accessor for the $Ignore package scoped variable. Defaults to an empty array ref


   Unexpected->ignore_class( $classname );

The $Ignore package scoped variable is an array ref of methods whose presence should be ignored by the error message leader. This method pushes $classname onto that array ref

Diagnostics ^


Dependencies ^


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, <>

License and Copyright ^

Copyright (c) 2017 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

syntax highlighting: