CapabilityError¶
from cascaqit import CapabilityError
An exception for a capability unsupported by the target or execution path. It is catchable as both ValueError and CASCAQitError.
Defaults are category=capability, code=CAPABILITY_ERROR, stage=validation, severity=error and retryable=False. Callers can override code, stage, object_path, suggestion and other fields. See CASCAQitError for the full constructor contract.
Check the target, simulation method and program structure. For example, requesting Analog-evolution dephasing for a purely Digital program may fail a prerequisite check. Capability rejection does not establish that backend execution started.
from cascaqit import CapabilityError
error = CapabilityError("Example failure", object_path="program")
assert error.to_error_ir().category == "capability"
assert error.to_diagnostic().code == "CAPABILITY_ERROR"
See Results and diagnostics for troubleshooting.
Return ErrorIR containing this exception’s category, code and context. Preserve the configured retryable value without initiating a retry.
Return DiagnosticsIR for display in a diagnostic list. Full provenance, cause and attached diagnostics remain in the exception and its ErrorIR.