Subject: | some issues in Error |
Hello,
I have some suggestions to improve the Error package:
In Error.pm, there is
...
sub run_clauses ($$$\@) {
my($clauses,$err,$wantarray,$result) = @_;
my $code = undef;
$err = new Error::Simple($err) unless ref($err);
...
I think it would be nice if there was a possibility to
configure an alternative Error-like class to be used for
building objects if $@ is just text; Error::Simple->new
is used in several places, perhapsit should be defined
as a default in $Error::simple_class or the like.
And further down, in Error::Simple, there is:
@args = ( -file => $1, -line => $2)
if($text =~ s/ at (\S+) line (\d+)(\.\n)?$//s);
This is not sufficient, since the "die" message may contain
the file handle and the line number. I think this should read:
@args = ( -file => $1, -line => $2)
if($text =~ s/\s+at\s+(\S+)\s+line\s+(\d+)(?:,\s*<[^>]
*>\s+line\s+\d+|)\.?\n?$//s);
Hope this helps,
Marek