From b9401f69409108be8b308df8a3f96f67fa7f7ceb Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 14 Jul 2003 10:52:13 +0000 Subject: [PATCH] - better error reporing from OpenIsis - added show_progress in global.conf to turn off progress bar git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@101 13eb9ef6-21d5-0310-b721-a9d68796d827 --- all2xml.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/all2xml.pl b/all2xml.pl index 8f0e41a..56daf87 100755 --- a/all2xml.pl +++ b/all2xml.pl @@ -293,8 +293,9 @@ print STDERR "reading ./import_xml/$type.xml\n"; # output current progress indicator my $last_p = 0; +print STDERR "## show_progress: $show_progress ##\n"; # XXX sub progress { - # XXX return if ($show_progress ne ""); + return if (! $show_progress); my $current = shift; my $total = shift || 1; my $p = int($current * 100 / $total); @@ -327,6 +328,19 @@ print STDERR "using: $type...\n"; $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); my $db = OpenIsis::open( $isis_db ); + # OpenIsis::ERR_BADF + if ($db == -4) { + print STDERR "FATAL: OpenIsis can't find file $isis_db\n"; + next; + # OpenIsis::ERR_IO + } elsif ($db == -5) { + print STDERR "FATAL: OpenIsis can't access file $isis_db\n"; + next; + } elsif ($db < 0) { + print STDERR "FATAL: OpenIsis unknown error $db with file $isis_db\n"; + next; + } + my $max_rowid = OpenIsis::maxRowid( $db ); print STDERR "Reading database: $isis_db [$max_rowid rows]\n"; -- 2.20.1