Software /
code /
prosody
Changeset
4293:419354c47c28
migrator/prosody_files: Don't choke on empty data stores for a user (thanks @eoranged)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 02 Jun 2011 17:18:23 +0100 |
parents | 4289:1e68721c02f2 |
children | 4294:d2406f0ce8a5 |
files | tools/migration/migrator/prosody_files.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_files.lua Thu Jun 02 15:28:12 2011 +0100 +++ b/tools/migration/migrator/prosody_files.lua Thu Jun 02 17:18:23 2011 +0100 @@ -98,7 +98,12 @@ local x = iter(); if x then dm.set_data_path(path); - x.data = assert(dm.load(x.user, x.host, x.store)); + local err; + x.data, err = dm.load(x.user, x.host, x.store); + if x.data == nil and err then + error(("Error loading data at path %s for %s@%s (%s store)") + :format(path, x.user or "<nil>", x.host or "<nil>", x.store or "<nil>"), 0); + end return x; end end;