Changeset

4234:ce92aafc9c03

tools/migration/migrator/prosody_sql: Throw a friendlier error when LuaDBI is not found
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Apr 2011 12:58:14 +0100
parents 4233:3c644c3b10e2
children 4235:899ffc1674b5
files tools/migration/migrator/prosody_sql.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_sql.lua	Tue Apr 05 12:36:56 2011 +0100
+++ b/tools/migration/migrator/prosody_sql.lua	Tue Apr 05 12:58:14 2011 +0100
@@ -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 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)