diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-08-20 19:04:47 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-08-20 19:04:47 -0400 |
commit | 29fc7f3c14b36770caad64cb82ec9177384ab61a (patch) | |
tree | c2079e8bf5d2944d7bc10b55c1b3fb76dcb07cc0 /lib/sisu/v5/db_indexes.rb | |
parent | v5 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_indexes.rb')
-rw-r--r-- | lib/sisu/v5/db_indexes.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/sisu/v5/db_indexes.rb b/lib/sisu/v5/db_indexes.rb index b76e4b26..a27deb67 100644 --- a/lib/sisu/v5/db_indexes.rb +++ b/lib/sisu/v5/db_indexes.rb @@ -82,9 +82,23 @@ module SiSU_DbIndex end end def conn_execute_array(sql_arr) - @conn.transaction do |conn| - sql_arr.each do |sql| - conn_execute_sql(conn,sql) + begin + @conn.transaction do |conn| + sql_arr.each do |sql| + conn_execute_sql(conn,sql) + end + end + 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 |