How to use the belter/src.stringifyError function in belter

To help you get started, we’ve selected a few belter 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 krakenjs / zoid / src / component / parent / index.js View on Github external
}).catch(errErr => { // eslint-disable-line unicorn/catch-error-name
            throw new Error(`An error was encountered while handling error:\n\n ${ stringifyError(err) }\n\n${ stringifyError(errErr) }`);

        }).then(() => {
            if (!props.onError) {
github paypal / paypal-smart-payment-buttons / src / lib / logger.js View on Github external
ZalgoPromise.onPossiblyUnhandledException(err => {

        logger.track({
            [FPTI_KEY.ERROR_CODE]: 'payments_sdk_error',
            [FPTI_KEY.ERROR_DESC]: stringifyErrorMessage(err)
        });

        logger.error('unhandled_error', {
            err: stringifyError(err)
        });

        // eslint-disable-next-line promise/no-promise-in-callback
        logger.flush().catch(noop);
    });
}
github paypal / paypal-sdk-client / src / logger.js View on Github external
ZalgoPromise.onPossiblyUnhandledException(err => {

        logger.track({
            [FPTI_KEY.ERROR_CODE]: 'payments_sdk_error',
            [FPTI_KEY.ERROR_DESC]: stringifyErrorMessage(err)
        });

        logger.error('unhandled_error', {
            err: stringifyError(err)
        });

        // eslint-disable-next-line promise/no-promise-in-callback
        logger.flush().catch(noop);
    });
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
})['catch'](function (err) {
            throw new Error('Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n' + stringifyError(err));
        });
github paypal / paypal-checkout-components / src / setup.js View on Github external
ZalgoPromise.onPossiblyUnhandledException(err => {

    logger.error('unhandled_error', {
        stack:   stringifyError(err),
        errtype: ({}).toString.call(err)
    });

    logger.track({
        [ FPTI_KEY.ERROR_CODE ]: 'checkoutjs_error',
        [ FPTI_KEY.ERROR_DESC ]: stringifyErrorMessage(err)
    });

    logger.flush();
});
github krakenjs / zoid / dist / module / component / window.js View on Github external
if (zoidcomp !== ZOID) {
        throw new Error('Window not rendered by zoid - got ' + zoidcomp);
    }

    if (!name) {
        throw new Error('Expected component name');
    }

    if (!encodedPayload) {
        throw new Error('Expected encoded payload');
    }

    try {
        return JSON.parse(base64decode(encodedPayload));
    } catch (err) {
        throw new Error('Can not decode window name payload: ' + encodedPayload + ': ' + stringifyError(err));
    }
});
github paypal / paypal-checkout-components / src / integrations / popupBridge.js View on Github external
.catch(err => {
                error(`popup_bridge_error`, { err: stringifyError(err) });
                return original();
            });
    }
github paypal / paypal-smart-payment-buttons / src / button / pay.js View on Github external
                .catch(err => getLogger().error('update_client_config_error', { err: stringifyError(err) }));
github krakenjs / zoid / src / child / window.js View on Github external
if (zoidcomp !== ZOID) {
            throw new Error(`Window not rendered by zoid - got ${ zoidcomp }`);
        }
    
        if (!name) {
            throw new Error(`Expected component name`);
        }
    
        if (!encodedPayload) {
            throw new Error(`Expected encoded payload`);
        }
    
        try {
            return JSON.parse(base64decode(encodedPayload));
        } catch (err) {
            throw new Error(`Can not decode window name payload: ${ encodedPayload }: ${ stringifyError(err) }`);
        }
    }, [ windowName ]);
}
github krakenjs / zoid / src / component / parent / index.js View on Github external
}).catch(err => {
            throw new Error(`Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n${ stringifyError(err) }`);
        });