diff options
Diffstat (limited to 'lib/utils/error.js')
-rw-r--r-- | lib/utils/error.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/utils/error.js b/lib/utils/error.js index 52281bf..27fa59d 100644 --- a/lib/utils/error.js +++ b/lib/utils/error.js @@ -41,6 +41,15 @@ var FileOutOfScopeError = TypedError({ code: 'EACCESS' }); +// A file is outside the scope +var RequireInstallError = TypedError({ + type: 'install.required', + message: '"{cmd}" is not installed.\n{install}', + cmd: null, + code: 'ENOENT', + install: '' +}); + // Error for nunjucks templates var TemplateError = WrappedError({ message: 'Error compiling template "{filename}": {origMessage}', @@ -55,12 +64,19 @@ var PluginError = WrappedError({ plugin: null }); -// Error for nunjucks templates +// Error with the book's configuration var ConfigurationError = WrappedError({ message: 'Error with book\'s configuration: {origMessage}', type: 'configuration' }); +// Error during ebook generation +var EbookError = WrappedError({ + message: 'Error during ebook generation: {origMessage}\n{stdout}', + type: 'ebook', + stdout: '' +}); + // Deprecate methods/fields function deprecateMethod(fn, msg) { return deprecated.method(msg, log.warn.ln, fn); @@ -74,6 +90,7 @@ module.exports = { ParsingError: ParsingError, OutputError: OutputError, + RequireInstallError: RequireInstallError, FileNotFoundError: FileNotFoundError, FileOutOfScopeError: FileOutOfScopeError, @@ -81,6 +98,7 @@ module.exports = { TemplateError: TemplateError, PluginError: PluginError, ConfigurationError: ConfigurationError, + EbookError: EbookError, deprecateMethod: deprecateMethod, deprecateField: deprecateField |