aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/dbi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/dbi.rb')
-rw-r--r--lib/sisu/v5/dbi.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb
index a7bbd822..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,10 +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