From 4d80033767fa916faa15709e69bafaf9a939a5a1 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 6 Jul 2004 19:10:13 +0000 Subject: [PATCH] better error message for missing tables --- FS/FS/Record.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 881b8ddb5..c3d783232 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -204,7 +204,10 @@ sub qsearch { my $dbh = dbh; my $table = $cache ? $cache->table : $stable; - my $pkey = $dbdef->table($table)->primary_key; + my $dbdef_table = $dbdef->table($table) + or die "No schema for table $table found - ". + "do you need to create it or run dbdef-create?"; + my $pkey = $dbdef_table->primary_key; my @real_fields = grep exists($record->{$_}), real_fields($table); my @virtual_fields = grep exists($record->{$_}), "FS::$table"->virtual_fields; -- 2.11.0