/**
 * CustomErrorContent defines the structure of the error content.
 */
export type CustomErrorContent = {
  message: string;
  context?: { [key: string]: any };
};

/**
 * CustomError is an abstract base class for custom errors.
 * It extends the built-in Error class and adds additional properties.
 */
export abstract class CustomError extends Error {
  // Abstract properties that must be implemented by subclasses
  abstract readonly statusCode: number;
  abstract readonly logging: boolean;

  /**
   * Constructs a new CustomError instance.
   * @param message - The error message.
   */
  constructor(message: string) {
    super(message);
    Object.setPrototypeOf(this, CustomError.prototype);
  }
}
