Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

461 B
Raw Blame
export const extractErrorMessage = (error: unknown) => {
  if (error instanceof Error) {
    return error.message;
  }

  if (typeof error === "string") {
    return error;
  }

  return "Unknown error";
};

export abstract class FlattenError extends Error {
  constructor(
    message: string,
    private flattenResult: Record<string, unknown>,
  ) {
    super(message);
  }

  public flatten(): Record<string, unknown> {
    return this.flattenResult;
  }
}