# HG changeset patch # User Kim Alvefur # Date 1457351069 -3600 # Node ID 2a82c55762a71b2576e625b3d45dadc8c71f778d # Parent 6055a0164d632f0e198dd9faadbbb8448e49d2ab mod_migrate: Log read and write errors instead of raising error diff -r 6055a0164d63 -r 2a82c55762a7 mod_migrate/mod_migrate.lua --- a/mod_migrate/mod_migrate.lua Mon Mar 07 11:15:28 2016 +0100 +++ b/mod_migrate/mod_migrate.lua Mon Mar 07 12:44:29 2016 +0100 @@ -24,8 +24,14 @@ local function migrate_user(username) module:log("info", "Migrating %s data for %s", source_store, username); local data, err = storage:get(username); - assert(data or err==nil, err); - assert(target:set(username, data)); + if not data and err then + module:log("error", "Could not read data: %s", err); + else + local ok, err = target:set(username, data); + if not ok then + module:log("error", "Could not write data: %s", err); + end + end end if store_type == "archive" then