diff options
Diffstat (limited to 'lib/sisu/v5/dbi.rb')
-rw-r--r-- | lib/sisu/v5/dbi.rb | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb index 8e27f443..df4b3180 100644 --- a/lib/sisu/v5/dbi.rb +++ b/lib/sisu/v5/dbi.rb @@ -102,7 +102,12 @@ module SiSU_DBI end def read_psql begin - require 'pg' + begin + require 'pg' + rescue LoadError + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('pg NOT FOUND (LoadError)') + end @conn=@db.psql.conn_pg rescue if @opt.act[:psql_create][:set]==:on @@ -119,11 +124,23 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet def read_sqlite begin begin - require 'sqlite3' + begin + require 'sqlite3' + rescue LoadError + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('sqlite3 NOT FOUND (LoadError)') + end @conn=@db.sqlite.conn_sqlite3 rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). - error('sqlite3 NOT FOUND (LoadError)') + errmsg='sqlite3 NOT FOUND (LoadError)' + if @opt.act[:no_stop][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error(errmsg + ', ' + 'attempt to proceed without sqlite output (as requested)') + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error(errmsg + ', ' + 'STOPPING') + exit + end end end end |