diff options
author | Matthew Wild <mwild1@gmail.com> | 2011-04-05 12:58:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2011-04-05 12:58:14 +0100 |
commit | cef7f598c03ede6a08a39720c861047d7ebf904d (patch) | |
tree | d86a4cc82298dc47b716367568e0df1687d2fd9d | |
parent | dddc15e0d925ced049794b46f5132ad68e7bf7ae (diff) | |
download | prosody-cef7f598c03ede6a08a39720c861047d7ebf904d.tar.gz prosody-cef7f598c03ede6a08a39720c861047d7ebf904d.zip |
tools/migration/migrator/prosody_sql: Throw a friendlier error when LuaDBI is not found
-rw-r--r-- | tools/migration/migrator/prosody_sql.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/migration/migrator/prosody_sql.lua b/tools/migration/migrator/prosody_sql.lua index 3a9172ff..b1f836be 100644 --- a/tools/migration/migrator/prosody_sql.lua +++ b/tools/migration/migrator/prosody_sql.lua @@ -1,6 +1,6 @@ local assert = assert; -local DBI = require "DBI"; +local have_DBI, DBI = pcall(require,"DBI"); local print = print; local type = type; local next = next; @@ -11,6 +11,10 @@ local mtools = require "migrator.mtools"; local tostring = tostring; local tonumber = tonumber; +if not have_DBI then + error("LuaDBI (required for SQL support) was not found, please see http://prosody.im/doc/depends#luadbi", 0); +end + module "prosody_sql" local function create_table(connection, params) |