BudgetExceededException
Exception thrown when a complexity budget is exceeded during test generation.
This is a fail-fast mechanism to prevent combinatorial explosion and out-of-memory errors when processing OpenAPI specs with deeply nested oneOf/anyOf/allOf schemas.
Why This Is an Exception (Not Outcome.Failure)
This exception is intentionally an exception rather than an Outcome.Failure because:
Immediate halt required: Budget violations represent hard limits that should stop processing immediately. There's no partial result that makes sense.
Deep recursion context: Budget checks occur deep in recursive schema traversal (SchemaMerger, CombinationBudget). Propagating Outcome at each recursion level would be verbose and error-prone.
Clear boundary: Exceptions bubble up naturally through the call stack and are caught at well-defined provider boundaries by
runProviderSafely, which converts them to Outcome.Failure for consistent handling upstream.
Handling
Callers should not attempt to catch this exception directly. Instead:
Providers wrap their logic in
runProviderSafely, which converts this to Outcome.FailureThe detailed message provides actionable guidance for increasing limits or simplifying schemas
See also
for the types of budgets that can be exceeded