kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Added more meaningful error messages
rodzic
088b78e687
commit
72c5e8864d
1
index.js
1
index.js
|
@ -530,5 +530,6 @@ async.series([
|
|||
});
|
||||
}
|
||||
], err => {
|
||||
debugger;
|
||||
if (err) logger.error("Error during startup: " + err.message);
|
||||
});
|
||||
|
|
|
@ -105,7 +105,13 @@ module.exports = class TaskManager{
|
|||
restoreTaskListFromDump(done){
|
||||
fs.readFile(TASKS_DUMP_FILE, (err, data) => {
|
||||
if (!err){
|
||||
let tasks = JSON.parse(data.toString());
|
||||
let tasks;
|
||||
try{
|
||||
tasks = JSON.parse(data.toString());
|
||||
}catch(e){
|
||||
done(new Error(`Could not load task list. It looks like the ${TASKS_DUMP_FILE} is corrupted (${e.message}). Please manually delete the file and try again.`));
|
||||
return;
|
||||
}
|
||||
|
||||
async.each(tasks, (taskJson, done) => {
|
||||
Task.CreateFromSerialized(taskJson, (err, task) => {
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = {
|
|||
let json = JSON.parse(output.join(""));
|
||||
done(null, json);
|
||||
}catch(err){
|
||||
done(err);
|
||||
done(new Error(`Could not load list of options from OpenDroneMap. Is OpenDroneMap installed in ${config.odm_path}? Make sure that OpenDroneMap is installed and that --odm_path is set properly: ${err.message}`));
|
||||
}
|
||||
})
|
||||
.on('error', done);
|
||||
|
|
Ładowanie…
Reference in New Issue