Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 6130
Status: resolved
Left: 0 min
Priority: 0/0
Queue: Error

Owner: Nobody
Requestors: MAREKR <Marek.Rouchal [...] gmx.net>
Cc:
AdminCc:

Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Mon Apr 26 08:16:23 2004 MAREKR - Ticket created  
Subject: some issues in Error
[text/plain 929b]
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
#   Fri Apr 07 14:29:25 2006 SHLOMIF - Status changed from 'new' to 'resolved'