import/export: Use Error objects for errors, not strings

This commit is contained in:
Richard Hansen 2021-03-17 18:28:39 -04:00 committed by John McLear
parent 59c167e31b
commit 216aecd433
3 changed files with 6 additions and 7 deletions

View file

@ -59,7 +59,8 @@ const doConvertTask = (task, callback) => {
soffice.on('exit', (code) => {
clearTimeout(hangTimeout);
if (code !== 0) {
return callback(`LibreOffice died with exit code ${code} and message: ${stdoutBuffer}`);
return callback(
new Error(`LibreOffice died with exit code ${code} and message: ${stdoutBuffer}`));
}
callback();
});