comparison mod_migrate/mod_migrate.lua @ 2812:fd4a5ba12fa2

mod_migrate: Catch failure to use user listing API and suggest the alternative
author Kim Alvefur <zash@zash.se>
date Wed, 01 Nov 2017 22:12:09 +0100
parents 17408ddd34b0
children cd9831b27746
comparison
equal deleted inserted replaced
2811:39156d6f7268 2812:fd4a5ba12fa2
60 if arg[4] then 60 if arg[4] then
61 for i = 4, #arg do 61 for i = 4, #arg do
62 migrate_user(arg[i]); 62 migrate_user(arg[i]);
63 end 63 end
64 else 64 else
65 for user in um.users(host) do 65 xpcall(function()
66 migrate_user(user); 66 for user in um.users(host) do
67 end 67 migrate_user(user);
68 end
69 end,
70 function (err)
71 module:log("error", "Could not list users, you'll have to supply them as arguments");
72 module:log("error", "The error was: %s", err);
73 end);
68 end 74 end
69 end 75 end
70 end 76 end