import { InternalServerErrorException } from '@nestjs/common';

/**
 * 部门树递归超过 maxDepth（规则 §5.3.16：不静默截断，显式抛异常 + 告警）
 */
export class DepartmentTreeTooDeepException extends InternalServerErrorException {
  constructor(rootDeptId: string, maxDepth: number) {
    super({
      message: `部门树递归超过最大深度 ${maxDepth}`,
      code: 'DEPARTMENT_TREE_TOO_DEEP',
      rootDeptId,
      maxDepth,
    });
  }
}
