How to use the @lwc/errors.generateErrorMessage function in @lwc/errors

To help you get started, we’ve selected a few @lwc/errors 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 salesforce / lwc / packages / @lwc / babel-plugin-component / src / utils.js View on Github external
function generateError(source, { errorInfo, messageArgs } = {}) {
    const message = generateErrorMessage(errorInfo, messageArgs);
    const error = source.buildCodeFrameError(message);

    error.filename = normalizeFilename(source);
    error.loc = normalizeLocation(source);
    error.lwcCode = errorInfo && errorInfo.code;
    return error;
}
github salesforce / lwc / packages / @lwc / jest-transformer / src / transforms / utils.js View on Github external
function generateError(path, { errorInfo, messageArgs } = {}) {
    const message = generateErrorMessage(errorInfo, messageArgs);
    const error = path.buildCodeFrameError(message);

    error.lwcCode = errorInfo.code;

    return error;
}