| Git-Class documentation | Contained in the Git-Class distribution. |
Git::Class::Role::Error
Kenichi Ishigaki, <ishigaki@cpan.org>
Copyright (C) 2009 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Git-Class documentation | Contained in the Git-Class distribution. |
package Git::Class::Role::Error; use Any::Moose '::Role'; use Carp::Clan qw/^(Git::Class|Mouse|Moose)::/; has '_die_on_error' => ( is => 'rw', isa => 'Bool', init_arg => 'die_on_error' ); has 'is_verbose' => ( is => 'rw', isa => 'Bool', init_arg => 'verbose', ); has '_error' => ( is => 'rw', isa => 'Str|Undef', # reader => '_last_error', # Mouse doesn't support reader yet trigger => sub { my ($self, $message) = @_; if (defined $message && $message ne '') { chomp $message; $self->_die_on_error ? croak $message : carp $message; } }, ); 1; __END__