ImportHandler: Pass ImportError to import hook

This commit is contained in:
Richard Hansen 2021-12-10 02:34:13 -05:00
parent d1da8f1ebd
commit 4d457f6296
3 changed files with 16 additions and 2 deletions

View file

@ -142,8 +142,8 @@ const doImport = async (req, res, padId) => {
}
const destFile = path.join(tmpDirectory, `etherpad_import_${randNum}.${exportExtension}`);
const importHandledByPlugin =
(await hooks.aCallAll('import', {srcFile, destFile, fileEnding, padId})).some((x) => x);
const context = {srcFile, destFile, fileEnding, padId, ImportError};
const importHandledByPlugin = (await hooks.aCallAll('import', context)).some((x) => x);
const fileIsEtherpad = (fileEnding === '.etherpad');
const fileIsHTML = (fileEnding === '.html' || fileEnding === '.htm');
const fileIsTXT = (fileEnding === '.txt');