Re: [svn:dbi] r13966 - dbi/trunk/lib/DBI/SQL

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Sun, May 09, 2010 at 10:45:23PM -0700, [email protected] wrote:
> - move from "die" to "croak"
> +                croak "Can't find columns\n" unless $self->{column_names};
> +                croak "Can't find columns\n" unless $self->{column_names};
> +                croak "Can't parse values\n" unless $self->{values};
> +    croak "Couldn't parse\n"
> +    croak "Bad ORDER BY clause '$str'\n" if @clause > 2;
> +    croak "Bad ORDER BY clause '$clause[1]'\n";
> + 	    croak "No column definition for '$_'\n";
> +    croak "Can't parse set clause\n"
> +        croak "Couldn't find WHERE clause in '$str'\n";
> +    croak "Couldn't parse WHERE expression '$str'\n"
> +    croak "Number of params '$num_params' does not match "
>        . "number of placeholders '$num_placeholders'\n"
> +        croak "No such column '$stmt_col_name'\n";
> +        croak "No such column '$stmt_col_name'\n";

A croak message that ends with a newline yields a messy error that has a
newline between the error and the file and line number details.

Best to delete the newlines.

> +    croak $@ if $@;

In this case you'll probably want to chomp $@ first.

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.