Permalink
Browse files

Merge branch 'hotfix-0.1.4' into trunk

- Resolve issue with optional tests loading Test::Trap.
  • Loading branch information...
2 parents 91cbaf0 + fbb3f09 commit 0675e5e398240b0c8bf5917d85e8f01ee9daa088 @Xiong committed Nov 20, 2011
View
2 README
@@ -1,4 +1,4 @@
-Error-Base version v0.1.3
+Error-Base version v0.1.4
J'avais cru plus difficile de mourir.
-- Louis XIV
View
@@ -1,4 +1,4 @@
-Error-Base version v0.1.2
+Error-Base version v0.1.3
J'avais cru plus difficile de mourir.
-- Louis XIV
View
@@ -9,7 +9,7 @@ package Error::Base;
use 5.008008;
use strict;
use warnings;
-use version; our $VERSION = qv('v0.1.3');
+use version; our $VERSION = qv('v0.1.4');
# Core modules
use overload # Overload Perl operations
@@ -374,7 +374,7 @@ sub _join_local {
#
sub _paired {
if ( scalar @_ % 2 ) { # an odd number modulo 2 is one: true
- die 'Error::Base internal error: unpaired args: ', $!;
+ die 'Error::Base internal error: unpaired args';
};
return @_;
}; ## _paired
@@ -636,7 +636,7 @@ Error::Base - Simple structured errors with full backtrace
=head1 VERSION
-This document describes Error::Base version v0.1.3
+This document describes Error::Base version v0.1.4
=head1 SYNOPSIS
View
@@ -9,7 +9,7 @@ package Error::Base;
use 5.008008;
use strict;
use warnings;
-use version; our $VERSION = qv('v0.1.2');
+use version; our $VERSION = qv('v0.1.3');
# Core modules
use overload # Overload Perl operations
@@ -56,7 +56,7 @@ sub _stringify {
return join qq{\n}, @{ $self->{-lines} }, q{};
}
else {
- return 'Error::Base internal error: failed to stringify $self';
+ return 'Error::Base internal error: stringifing unthrown object';
};
}; ## _stringify
@@ -374,7 +374,7 @@ sub _join_local {
#
sub _paired {
if ( scalar @_ % 2 ) { # an odd number modulo 2 is one: true
- die 'Error::Base internal error: unpaired args: ', $!;
+ die 'Error::Base internal error: unpaired args';
};
return @_;
}; ## _paired
@@ -636,7 +636,7 @@ Error::Base - Simple structured errors with full backtrace
=head1 VERSION
-This document describes Error::Base version v0.1.2
+This document describes Error::Base version v0.1.3
=head1 SYNOPSIS
@@ -982,6 +982,13 @@ or hash. Don't pass such references as values to any key with the wrong sigil.
Called a method without class or object. Did you call as function?
+=item C<< stringifing unthrown object >>
+
+An object of this class will stringify to its printable error message
+(including backtrace if any) when thrown. There is nothing to see (yet) if
+you try to print an object that has been constructed but not (yet) thrown.
+This error is not fatal; it is returned as the stringification.
+
=item C<< in _late eval: >>
Attempted to late-interpolate badly. Check your code. The interpolation
@@ -3,7 +3,7 @@ package Error::Base::Cookbook;
use 5.008008;
use strict;
use warnings;
-use version; our $VERSION = qv('v0.1.3');
+use version; our $VERSION = qv('v0.1.4');
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
@@ -39,7 +39,7 @@ Error::Base::Cookbook - Examples of Error::Base usage
=head1 VERSION
-This document describes Error::Base version v0.1.3
+This document describes Error::Base version v0.1.4
=head1 DESCRIPTION
@@ -3,7 +3,7 @@ package Error::Base::Cookbook;
use 5.008008;
use strict;
use warnings;
-use version; our $VERSION = qv('v0.1.2');
+use version; our $VERSION = qv('v0.1.3');
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
@@ -39,7 +39,7 @@ Error::Base::Cookbook - Examples of Error::Base usage
=head1 VERSION
-This document describes Error::Base version v0.1.2
+This document describes Error::Base version v0.1.3
=head1 DESCRIPTION
View
@@ -1,5 +1,8 @@
Revision history for Error-Base
+v0.1.4 2011-11-19 16:10:47
+ - Resolve issue with optional tests loading Test::Trap.
+
v0.1.3 2011-11-18 18:19:00
- Enforce strictures and warnings in _late() string eval.
- Test internal error conditions.
View
@@ -23,22 +23,25 @@ my $self ;
# Load non-core modules conditionally
BEGIN{
+ my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
- $::module_loaded = !$@; # loaded if no error
+ my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
-}; ## BEGIN
+ if ( $module_loaded ) {
+ note($diag);
+ }
+ else {
+ diag('Test::Trap required to execute this test script; skipping.');
+ pass;
+ done_testing(1);
+ exit 0;
+ };
-$tc++;
-$diag = $base . 'load-test-trap';
-pass($diag);
-if ( not $::module_loaded ) {
- note('Test::Trap (recommended) required to execute this test script.');
- exit 0;
-};
+}; ## BEGIN
#----------------------------------------------------------------------------#
View
@@ -23,22 +23,25 @@ my $self ;
# Load non-core modules conditionally
BEGIN{
+ my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
- $::module_loaded = !$@; # loaded if no error
+ my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
-}; ## BEGIN
+ if ( $module_loaded ) {
+ note($diag);
+ }
+ else {
+ diag('Test::Trap required to execute this test script; skipping.');
+ pass;
+ done_testing(1);
+ exit 0;
+ };
-$tc++;
-$diag = $base . 'load-test-trap';
-pass($diag);
-if ( not $::module_loaded ) {
- note('Test::Trap (recommended) required to execute this test script.');
- exit 0;
-};
+}; ## BEGIN
#----------------------------------------------------------------------------#
View
@@ -23,22 +23,25 @@ my $self ;
# Load non-core modules conditionally
BEGIN{
+ my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
- $::module_loaded = !$@; # loaded if no error
+ my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
-}; ## BEGIN
+ if ( $module_loaded ) {
+ note($diag);
+ }
+ else {
+ diag('Test::Trap required to execute this test script; skipping.');
+ pass;
+ done_testing(1);
+ exit 0;
+ };
-$tc++;
-$diag = $base . 'load-test-trap';
-pass($diag);
-if ( not $::module_loaded ) {
- note('Test::Trap (recommended) required to execute this test script.');
- exit 0;
-};
+}; ## BEGIN
#----------------------------------------------------------------------------#
View
@@ -23,22 +23,25 @@ my $self ;
# Load non-core modules conditionally
BEGIN{
+ my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
- $::module_loaded = !$@; # loaded if no error
+ my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
-}; ## BEGIN
+ if ( $module_loaded ) {
+ note($diag);
+ }
+ else {
+ diag('Test::Trap required to execute this test script; skipping.');
+ pass;
+ done_testing(1);
+ exit 0;
+ };
-$tc++;
-$diag = $base . 'load-test-trap';
-pass($diag);
-if ( not $::module_loaded ) {
- note('Test::Trap (recommended) required to execute this test script.');
- exit 0;
-};
+}; ## BEGIN
#----------------------------------------------------------------------------#
Oops, something went wrong.

0 comments on commit 0675e5e

Please sign in to comment.