Subject: | PATCH: bugfix for error handling in new() |
Without this patch, the error message is never seen. It is stuffed in
the object, but the object is not returned from new(), so it is
inaccessible.
The consistent and useful thing to do is just croak the error, which is
how error handling in other parts of new() work.
Mark
Subject: | parse-csv.patch |
--- old-alphasite/perllib/Parse/CSV.pm 2006-10-10 14:34:09.000000000 -0400
+++ new-alphasite/perllib/Parse/CSV.pm 2006-10-10 14:34:09.000000000 -0400
@@ -227,8 +227,7 @@
# Parse the line into columns
unless ( $self->{csv_xs}->parse($line) ) {
- $self->{errstr} = "Failed to parse header line from CSV";
- return undef;
+ Carp::croak("Failed to parse header line from CSV");
}
# Turn the array ref into a hash if needed