Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).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) {
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);
});
}
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);
});
})['catch'](function (err) {
throw new Error('Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n' + stringifyError(err));
});
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();
});
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));
}
});
.catch(err => {
error(`popup_bridge_error`, { err: stringifyError(err) });
return original();
});
}
.catch(err => getLogger().error('update_client_config_error', { err: stringifyError(err) }));
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 ]);
}
}).catch(err => {
throw new Error(`Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n${ stringifyError(err) }`);
});