Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

571 B
Raw Blame
import { logger } from "./logger";
import { finishCommand } from "../telemetry/command-tracking";

export async function handleError(error: unknown) {
  await finishCommand(1, error);
  logger.break();
  logger.error(
    `Something went wrong. Please check the error below for more details.`
  );
  logger.error(`If the problem persists, please open an issue on GitHub.`);
  logger.error("");

  if (typeof error === "string") {
    logger.error(error);
  } else if (error instanceof Error) {
    logger.error(error.message);
  }

  logger.break();
  process.exit(1);
}