How to use the @loki/core.serializeError function in @loki/core

To help you get started, we’ve selected a few @loki/core 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 oblador / loki / packages / renderer-aws-lambda / src / create-aws-lambda-renderer.js View on Github external
const createChromeAWSLambdaRenderer = () => async event => {
  const command = commands[event.command];
  if (!command) {
    throw serializeError(new Error(`Unknown command "${event.command}"`));
  }
  const target = createChromeAppTarget({
    baseUrl: event.baseUrl,
  });
  try {
    await target.start({
      chromeFlags: chromium.args,
      chromePath: await chromium.executablePath,
    });
    return await command(target, event);
  } catch (error) {
    throw serializeError(unwrapError(error));
  } finally {
    await target.stop();
  }
};
github oblador / loki / packages / renderer-aws-lambda / src / create-aws-lambda-renderer.js View on Github external
const createChromeAWSLambdaRenderer = () => async event => {
  const command = commands[event.command];
  if (!command) {
    throw serializeError(new Error(`Unknown command "${event.command}"`));
  }
  const target = createChromeAppTarget({
    baseUrl: event.baseUrl,
  });
  try {
    await target.start({
      chromeFlags: chromium.args,
      chromePath: await chromium.executablePath,
    });
    return await command(target, event);
  } catch (error) {
    throw serializeError(unwrapError(error));
  } finally {
    await target.stop();
  }
};