/** An error whose message is safe to show to an MCP client / API caller. */
export class PublicError extends Error {
  constructor(
    message: string,
    public readonly status = 400,
    public readonly code = 'bad_request',
  ) {
    super(message)
    this.name = 'PublicError'
  }
}

export class NotFoundError extends PublicError {
  constructor(what: string) {
    super(`${what} not found`, 404, 'not_found')
    this.name = 'NotFoundError'
  }
}
