// runtime/subsystems/jobs/jobs-errors.ts
var JobTypeNotFoundError = class extends Error {
  constructor(jobType) {
    super(`No job definition registered for type '${jobType}'.`);
    this.jobType = jobType;
  }
  jobType;
  name = "JobTypeNotFoundError";
};
var JobCollisionError = class extends Error {
  constructor(jobType, concurrencyKey, incumbent) {
    super(
      `Job type '${jobType}' has an in-flight run with concurrency_key '${concurrencyKey}' (incumbent ${incumbent.id}); collision_mode=reject.`
    );
    this.jobType = jobType;
    this.concurrencyKey = concurrencyKey;
    this.incumbent = incumbent;
  }
  jobType;
  concurrencyKey;
  incumbent;
  name = "JobCollisionError";
};
var JobNotReplayableError = class extends Error {
  constructor(runId, currentStatus) {
    super(
      `Run ${runId} is not replayable from status '${currentStatus}'. Only 'completed', 'failed', 'timed_out', and 'canceled' are eligible.`
    );
    this.runId = runId;
    this.currentStatus = currentStatus;
  }
  runId;
  currentStatus;
  name = "JobNotReplayableError";
};
var JobTemplateFieldMissingError = class extends Error {
  constructor(template, field) {
    super(
      `Template '${template}' references input field '${field}' which is missing or undefined on the payload.`
    );
    this.template = template;
    this.field = field;
  }
  template;
  field;
  name = "JobTemplateFieldMissingError";
};
var MissingTenantIdError = class extends Error {
  constructor(method) {
    super(
      `MissingTenantIdError: JobsDomainModule was configured with multiTenant=true but ${method} was called without tenantId (undefined). Pass an explicit tenantId, or pass null for cross-tenant work.`
    );
    this.method = method;
  }
  method;
  name = "MissingTenantIdError";
};
var BootValidationError = class extends Error {
  constructor(missingHandlers) {
    super(
      `BootValidationError: ${missingHandlers.length} orphaned job type(s) in 'job' table with no matching @JobHandler in the running process: [${missingHandlers.join(", ")}]. Either register the handler(s) or remove the rows.`
    );
    this.missingHandlers = missingHandlers;
  }
  missingHandlers;
  name = "BootValidationError";
};
var ReservedPoolViolationError = class extends Error {
  constructor(offenders) {
    super(
      `ReservedPoolViolationError: ${offenders.length} @JobHandler(s) target reserved pools \u2014 reserved pools are framework-only:
` + offenders.map((o) => `  - ${o.handlerClass} \u2192 pool='${o.pool}'`).join("\n")
    );
    this.offenders = offenders;
  }
  offenders;
  name = "ReservedPoolViolationError";
};

export {
  JobTypeNotFoundError,
  JobCollisionError,
  JobNotReplayableError,
  JobTemplateFieldMissingError,
  MissingTenantIdError,
  BootValidationError,
  ReservedPoolViolationError
};
//# sourceMappingURL=chunk-T4BIIU5E.js.map