How to use the jsdoc/util/logger.error function in jsdoc

To help you get started, we’ve selected a few jsdoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github camptocamp / ngeo / jsdoc / template / publish.js View on Github external
Object.keys(sourceFiles).forEach(function(file) {
        let source;
        // links are keyed to the shortened path in each doclet's `meta.shortpath` property
        let sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
        helper.registerLink(sourceFiles[file].shortened, sourceOutfile);

        try {
            source = {
                kind: 'source',
                code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
            };
        }
        catch(e) {
            logger.error('Error while generating source file %s: %s', file, e.message);
        }

        generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
            false);
    });
}
github googlearchive / npm-publish-scripts / src / themes / jsdoc / publish.js View on Github external
Object.keys(sourceFiles).forEach(function(file) {
        var source;
        // links are keyed to the shortened path in each doclet's `meta.shortpath` property
        var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
        helper.registerLink(sourceFiles[file].shortened, sourceOutfile);

        try {
            source = {
                kind: 'source',
                code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
            };
        }
        catch (e) {
            logger.error('Error while generating source file %s: %s', file, e.message);
        }

        generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
            false);
    });
}
github jsdoc / jsdoc / lib / jsdoc / util / error.js View on Github external
exports.handle = e => {
    const logger = require('jsdoc/util/logger');
    let msg = e ? ( e.message || JSON.stringify(e) ) : '';

    // include the error type if it's an Error object
    if (e instanceof Error) {
        msg = `${e.name}: ${msg}`;
    }

    logger.error(msg);
};
github softlayer / ember-cli-jsdoc / jsdocTemplates / default / publish.js View on Github external
Object.keys(sourceFiles).forEach(function(file) {
        var source;
        // links are keyed to the shortened path in each doclet's `meta.shortpath` property
        var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
        helper.registerLink(sourceFiles[file].shortened, sourceOutfile);

        try {
            source = {
                kind: 'source',
                code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
            };
        }
        catch(e) {
            logger.error('Error while generating source file %s: %s', file, e.message);
        }

        generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
            false);
    });
}
github jsdoc / jsdoc / packages / jsdoc / lib / jsdoc / tutorial / resolver.js View on Github external
item.children.forEach(child => {
                const childTutorial = exports.root.getByName(child);

                if (!childTutorial) {
                    logger.error('Missing child tutorial: %s', child);
                }
                else {
                    childTutorial.setParent(current);
                }
            });
        }
github BladeRunnerJS / brjs / brjs-sdk / sdk / jsdoc-toolkit-resources / jsdoc-toolkit / lib / jsdoc / util / markdown.js View on Github external
source = escapeUnderscores(source);
            source = escapeUrls(source);

            result = marked(source, { renderer: markedRenderer })
                .replace(/\s+$/, '')
                .replace(/'/g, "'");
            result = unescapeUrls(result);

            return result;
        };
        parserFunction._parser = parserNames.marked;
        return parserFunction;
    }
    else {
        logger.error('Unrecognized Markdown parser "%s". Markdown support is disabled.',
            parserName);
    }
}
github jsdoc / jsdoc / packages / jsdoc / lib / jsdoc / tag.js View on Github external
function parseType({text, originalTitle}, {canHaveName, canHaveType}, meta) {
    try {
        return tag.type.parse(text, canHaveName, canHaveType);
    }
    catch (e) {
        logger.error(
            'Unable to parse a tag\'s type expression%s with tag title "%s" and text "%s": %s',
            meta.filename ? ( ` for source file ${path.join(meta.path, meta.filename)}${meta.lineno ? (` in line ${meta.lineno}`) : ''}` ) : '',
            originalTitle,
            text,
            e.message
        );

        return {};
    }
}
github HumanBrainProject / jsdoc-sphinx / template / publish.js View on Github external
generator(context, handleErrorCallback(function(err, data) {
      if (err) {
        logger.error('cannot generate ' + target);
        logger.debug(err);
        return;
      }
      write(target, data, cb);
    }));
  };
github BladeRunnerJS / brjs / brjs-sdk / sdk / jsdoc-toolkit-resources / jsdoc-toolkit / lib / jsdoc / borrow.js View on Github external
exports.resolveBorrows = function(doclets) {
    var doclet;

    if (!doclets.index) {
        logger.error('Unable to resolve borrowed symbols, because the docs have not been indexed.');
        return;
    }

    for (var i = 0, l = doclets.index.borrowed.length; i < l; i++) {
        doclet = doclets.index.borrowed[i];

        cloneBorrowedDoclets(doclet, doclets);
        delete doclet.borrowed;
    }

    doclets.index.borrowed = [];
};
github jsdoc / jsdoc / packages / jsdoc / lib / jsdoc / tag / dictionary / definitions.js View on Github external
exports.defineTags = (dictionary, tagDefinitions) => {
    let dictionaries;

    if (!tagDefinitions) {
        dictionaries = env.conf.tags.dictionaries;

        if (!dictionaries) {
            logger.error('The configuration setting "tags.dictionaries" is undefined. ' +
                'Unable to load tag definitions.');

            return;
        }
        else {
            dictionaries = dictionaries.slice(0).reverse();
        }

        dictionaries.forEach(dictName => {
            const tagDefs = exports[DEFINITIONS[dictName]];

            if (!tagDefs) {
                logger.error('The configuration setting "tags.dictionaries" contains ' +
                    'the unknown dictionary name %s. Ignoring the dictionary.', dictName);

                return;