export class ApiV1Error extends Error {
  status: number;
  code: string;
  details?: unknown;

  constructor(status: number, code: string, message: string, details?: unknown) {
    super(message);
    this.status = status;
    this.code = code;
    this.details = details;
  }
}

export function isApiV1Error(error: unknown): error is ApiV1Error {
  return error instanceof ApiV1Error;
}
