diff --git a/lib/renderer.js b/lib/renderer.js index 768c8bb..e74367a 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -20,10 +20,11 @@ function pandocProcess(pandocPath, args, timeout, filePath, input) { return result.stdout; } if (result.error) { - printMessage('ERROR', filePath, result.error); + printMessage('ERROR', filePath, result.error.toString()); throw result.error; } - printMessage('ERROR', filePath, 'pandoc exited with code ' + result.status + (result.stderr ? ': ' + result.stderr : '.')); + const error_msg = 'pandoc exited with code ' + result.status + (result.stderr ? ': ' + result.stderr : '.'); + printMessage('ERROR', filePath, error_msg); throw Error(error_msg); }