From: erickson Date: Wed, 27 Jul 2005 00:43:24 +0000 (+0000) Subject: debugging dependency loading X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=63a757fde0aec7d67e66b6b0c0bcd6811fb50a57;p=Evergreen.git debugging dependency loading git-svn-id: svn://svn.open-ils.org/ILS/trunk@1528 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm index ce96d2d07f..d3ad360d4f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm @@ -40,7 +40,13 @@ sub initialize { @OpenILS::Application::Storage::CDBI::ISA = ( $driver ); eval 'use OpenILS::Application::Storage::Publisher;'; + if ($@) { + $log->debug("FAILURE LOADING Publisher! $@", ERROR); + } eval 'use OpenILS::Application::Storage::WORM;'; + if ($@) { + $log->debug("FAILURE LOADING WORM! $@", ERROR); + } } sub child_init { @@ -59,6 +65,7 @@ sub child_init { $log->debug("Success initializing driver!", DEBUG); return 1; } + $log->debug("FAILURE initializing driver!", ERROR); return 0; } diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm index 6b5593d682..ba51e2cc97 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm @@ -50,11 +50,21 @@ ); my $master = shift @$_db_params; - $master_db = DBI->connect("dbi:Pg:host=$$master{host};dbname=$$master{db}",$$master{user},$$master{pw}, \%attrs); + $log->debug("Attmpting to connet to $$master{db} at $$master{host}", INFO); + + try { + $master_db = DBI->connect("dbi:Pg:host=$$master{host};dbname=$$master{db}",$$master{user},$$master{pw}, \%attrs) || + throw OpenSRF::EX::ERROR ("Couldn't connect to $$master{db} on $$master{host} as $$master{user}!!"); + } catch Error with { + my $e = shift; + $log->debug("Error connecting to database:\n\t$e\n\t$DBI::errstr", ERROR); + throw $e; + }; + + $log->debug("Connected to MASTER db $$master{db} at $$master{host}", INFO); + $master_db->do("SET NAMES '$$master{client_encoding}';") if ($$master{client_encoding}); - $log->debug("Connected to MASTER db '$$master{db} at $$master{host}", INFO); - for my $db (@$_db_params) { push @slave_dbs, DBI->connect("dbi:Pg:host=$$db{host};dbname=$$db{db}",$$db{user},$$db{pw}, \%attrs); $slave_dbs[-1]->do("SET NAMES '$$db{client_encoding}';") if ($$master{client_encoding}); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm index 1e7fe4d1dd..50c10bc2dc 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm @@ -3,7 +3,7 @@ use base qw/OpenILS::Application::Storage/; our $VERSION = 1; use Digest::MD5 qw/md5_hex/; -use OpenSRF::EX qw/:try/;; +use OpenSRF::EX qw/:try/; use OpenSRF::Utils; use OpenSRF::Utils::Logger qw/:level/; use OpenILS::Utils::Fieldmapper; @@ -313,6 +313,12 @@ use OpenILS::Application::Storage::Publisher::money; use OpenILS::Application::Storage::Publisher::permission; '; +if ($@) { + $log->debug("ARG! Couldn't load (at least one) class Publisher: $@", ERROR); + throw OpenSRF::EX::ERROR ("ARG! Couldn't load (at least one) class Publisher: $@"); +} + + for my $fmclass ( (Fieldmapper->classes) ) { next if ($fmclass->is_virtual); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/config.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/config.pm index 8897fb3af2..ce5f55d657 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/config.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/config.pm @@ -1,6 +1,6 @@ package OpenILS::Application::Storage::Publisher::config; use base qw/OpenILS::Application::Storage/; -#use OpenILS::Application::Storage::CDBI::config; +use OpenILS::Application::Storage::CDBI::config; sub metabib_field_all {