[interchange] Throw configuration error on missing database table while parsing AUTO_SEQUENCE directives.

Stefan Hornburg interchange-cvs at icdevgroup.org
Wed Jul 14 08:49:28 UTC 2010


commit 261940cde17fb0f2bf11902e7f38683f678e4b38
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed Jul 14 10:34:41 2010 +0200

    Throw configuration error on missing database table while parsing AUTO_SEQUENCE directives.
    This prevents the following runtime error and displays the affected database table.
    Cannot open database text source file /path/to/catalog/products/AUTO_SEQUENCE: No such file or directory

 lib/Vend/Config.pm |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm
index c27c247..4938e9e 100644
--- a/lib/Vend/Config.pm
+++ b/lib/Vend/Config.pm
@@ -4420,6 +4420,11 @@ sub parse_database {
 	if($new) {
 		my($file, $type) = split /[\s,]+/, $remain, 2;
 		$d->{'file'} = $file;
+		if($file eq 'AUTO_SEQUENCE') {
+			# database table missing for AUTO_SEQUENCE directive
+			config_error('Missing database %s for AUTO_SEQUENCE %s.', $database, $type);
+			return $c;
+		}
 		if(		$type =~ /^\d+$/	) {
 			$d->{'type'} = $type;
 		}



More information about the interchange-cvs mailing list