export class HttpError extends Error {
  public readonly status: number;
  public readonly body: Record<string, unknown>;

  constructor(status: number, message: string, details?: Record<string, unknown>) {
    super(message);
    this.name = "HttpError";
    this.status = status;
    this.body = details ? { error: message, details } : { error: message };
  }
}
