]> Dogcows Code - chaz/p5-File-KDBX/commitdiff
Cleanup some commented code
authorCharles McGarvey <ccm@cpan.org>
Wed, 20 Apr 2022 16:23:39 +0000 (10:23 -0600)
committerCharles McGarvey <ccm@cpan.org>
Sun, 1 May 2022 00:29:00 +0000 (18:29 -0600)
lib/File/KDBX/Error.pm

index 7f44942caaee88e9a16acd9e72e6399bcb6422be..d23837a8d3ba5018a89cdf7ae7a23a198d5e70b6 100644 (file)
@@ -39,7 +39,7 @@ sub new {
 
     my $error = delete $args{_error};
     my $e = $error;
-    $e =~ s/ at \H+ line \d+.*//g;
+    $e =~ s/ at \H+ line \d+.*//g;
 
     my $self = bless {
         details     => \%args,
@@ -108,12 +108,37 @@ sub details {
     return $details;
 }
 
+=attr errno
+
+Get the value of C<errno> when the exception was created.
+
+=cut
+
 sub errno { $_[0]->{errno} }
 
+=attr previous
+
+Get the value of C<$@> (i.e. latest exception) at the time the exception was created.
+
+
+=cut
+
 sub previous { $_[0]->{previous} }
 
+=attr trace
+
+Get a stack trace indicating where in the code the exception was created.
+
+=cut
+
 sub trace { $_[0]->{trace} // [] }
 
+=attr type
+
+Get the exception type, if any.
+
+=cut
+
 sub type { $_[0]->details->{type} // '' }
 
 =method to_string
@@ -130,16 +155,10 @@ variable to truthy to stringify the whole error object.
 
 sub _cmp { "$_[0]" cmp "$_[1]" }
 
-sub PROPAGATE {
-    'wat';
-}
-
 sub to_string {
     my $self = shift;
-    # return "uh oh\n";
     my $msg = "$self->{trace}[0]";
-    $msg .= '.' if $msg !~ /[\.\!\?]$/; # Why does this cause infinite recursion on some perls?
-    # $msg .= '.' if $msg !~ /(?:\.|!|\?)$/;
+    $msg .= '.' if $msg !~ /[\.\!\?]$/;
     if ($ENV{DEBUG}) {
         require Data::Dumper;
         local $Data::Dumper::Indent = 1;
This page took 0.025113 seconds and 4 git commands to generate.