/**
 * Identity domain errors. The API layer maps these to HTTP; messages are
 * deliberately generic where leakage matters.
 */

export class InvalidCredentialsError extends Error {
  constructor() {
    super('Invalid credentials');
    this.name = 'InvalidCredentialsError';
  }
}

export class EmailAlreadyRegisteredError extends Error {
  constructor() {
    super('Email already registered');
    this.name = 'EmailAlreadyRegisteredError';
  }
}

export class RateLimitedError extends Error {
  constructor(public readonly retryAfterMs: number) {
    super('Too many attempts');
    this.name = 'RateLimitedError';
  }
}
