aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/db_create.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-20 19:04:47 -0400
committerRalph Amissah <ralph@amissah.com>2014-08-20 19:04:47 -0400
commit29fc7f3c14b36770caad64cb82ec9177384ab61a (patch)
treec2079e8bf5d2944d7bc10b55c1b3fb76dcb07cc0 /lib/sisu/v5/db_create.rb
parentv5 v6: hub options, introduce "error override" --no-stop or --errors-as-warnings (diff)
v5 v6: start making use of --no-stop command
Diffstat (limited to 'lib/sisu/v5/db_create.rb')
-rw-r--r--lib/sisu/v5/db_create.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/sisu/v5/db_create.rb b/lib/sisu/v5/db_create.rb
index 956a470a..19e81998 100644
--- a/lib/sisu/v5/db_create.rb
+++ b/lib/sisu/v5/db_create.rb
@@ -117,10 +117,38 @@ module SiSU_DbCreate
end
end
def conn_exec_pg(sql)
- @conn.exec_params(sql)
+ begin
+ @conn.exec_params(sql)
+ rescue
+ if @conn.is_a?(NilClass)
+ errmsg="No pg connection (check pg dependencies)"
+ if @opt.act[:no_stop][:set]==:on
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
+ error("#{errmsg}, proceeding without pg output (as requested)")
+ else
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
+ error("#{errmsg}, STOPPING")
+ exit
+ end
+ end
+ end
end
def conn_exec_sqlite(sql)
+ begin
@conn.execute(sql)
+ rescue
+ if @conn.is_a?(NilClass)
+ errmsg="No sqlite3 connection (check sqlite3 dependencies)"
+ if @opt.act[:no_stop][:set]==:on
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
+ error("#{errmsg}, proceeding without sqlite output (as requested)")
+ else
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
+ error("#{errmsg}, STOPPING")
+ exit
+ end
+ end
+ end
end
def metadata_and_text
if (@opt.act[:verbose_plus][:set]==:on \