Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

660 B
Raw Blame
export type AppErrorCode =
  | "UNAUTHORIZED"
  | "INVALID_SESSION"
  | "NOT_FOUND"
  | "FORBIDDEN"
  | "INTERNAL_SERVER_ERROR"
  | "PAYMENT_REQUIRED"
  | "PAYLOAD_TOO_LARGE"
  | "POLL_FULL"
  | "SERVICE_UNAVAILABLE"
  | "SETUP_REQUIRED"
  | "TOO_MANY_REQUESTS"
  | "CONFERENCING_NOT_CONNECTED"
  | "CONFERENCING_CANNOT_HOST"
  | "CONFERENCING_FAILED";

export class AppError extends Error {
  code: AppErrorCode;
  constructor({
    code,
    message,
    cause,
  }: {
    code: AppErrorCode;
    message: string;
    cause?: unknown;
  }) {
    super(`[${code}]: ${message}`);
    this.name = "AppError";
    this.code = code;
    this.cause = cause;
  }
}