Software /
code /
prosody
Comparison
tools/migration/migrator/prosody_files.lua @ 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 |
parent | 4241:49b9e73e31ef |
child | 5021:85b2689dbcfe |
comparison
equal
deleted
inserted
replaced
4289:1e68721c02f2 | 4293:419354c47c28 |
---|---|
96 local iter = mtools.sorted { | 96 local iter = mtools.sorted { |
97 reader = function() | 97 reader = function() |
98 local x = iter(); | 98 local x = iter(); |
99 if x then | 99 if x then |
100 dm.set_data_path(path); | 100 dm.set_data_path(path); |
101 x.data = assert(dm.load(x.user, x.host, x.store)); | 101 local err; |
102 x.data, err = dm.load(x.user, x.host, x.store); | |
103 if x.data == nil and err then | |
104 error(("Error loading data at path %s for %s@%s (%s store)") | |
105 :format(path, x.user or "<nil>", x.host or "<nil>", x.store or "<nil>"), 0); | |
106 end | |
102 return x; | 107 return x; |
103 end | 108 end |
104 end; | 109 end; |
105 sorter = function(a, b) | 110 sorter = function(a, b) |
106 local a_host, a_user, a_store = a.host or "", a.user or "", a.store or ""; | 111 local a_host, a_user, a_store = a.host or "", a.user or "", a.store or ""; |