summaryrefslogtreecommitdiff
path: root/FS/FS/Record.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-04-16 21:12:22 -0700
committerMark Wells <mark@freeside.biz>2013-04-16 21:12:22 -0700
commitb595a15e182ce891241bf710cd7dbaf84570edd4 (patch)
treece4a99480fa568353702413fe3a4e1d9a51d7c49 /FS/FS/Record.pm
parent90d53f2bfaac6b65afb211e81c1f9aa160da9e1c (diff)
more useful qsearch error messages
Diffstat (limited to 'FS/FS/Record.pm')
-rw-r--r--FS/FS/Record.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index 42af68c..3d4bfae 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -458,7 +458,13 @@ sub qsearch {
# grep defined( $record->{$_} ) && $record->{$_} ne '', @fields
# ) or croak "Error executing \"$statement\": ". $sth->errstr;
- $sth->execute or croak "Error executing \"$statement\": ". $sth->errstr;
+ my $ok = $sth->execute;
+ if (!$ok) {
+ my $error = "Error executing \"$statement\"";
+ $error .= ' (' . join(', ', map {"'$_'"} @value) . ')' if @value;
+ $error .= ': '. $sth->errstr;
+ croak $error;
+ }
my $table = $stable[0];
my $pkey = '';