- integrations
- Python
- ocx_sdk
WhichResult, error_envelope
WhichResultclassdataclass#
Re-exported from
ocx_sdk._resultsView sourceclass WhichResult(path: str, kind: str)Where one identifier resolves on disk, per package which.
Attributes
| Name | Type | Description |
|---|---|---|
path | str | The resolved location. |
kind | str | "package" for a store directory, "shim" for a shim. |
from_dictmethodclassmethod#
def from_dict(data: Mapping[str, Any]) -> WhichResultBuild from one decoded value of the keyed object.
error_envelopefunction#
Re-exported from
ocx_sdk._resultsView sourcedef error_envelope(error: OcxProcessError) -> ErrorEnvelope | NoneReturn the structured failure a non-zero exit carried, else None.
The dual of partial_report: where that recovers the report a
report-then-fail command wrote, this recovers the envelope a hard
failure wrote instead. A failure never carries both, so for any one
error at most one of the two answers.
try: ocx.package.claim("acme/widget", repository="oci://ghcr.io/acme/widget")except DataError as exc: envelope = error_envelope(exc) if envelope is None or "already claimed" not in envelope.message: raiseParameters
| Name | Type | Description |
|---|---|---|
error | OcxProcessError | The caught process failure. |
Returns
ErrorEnvelope | NoneNonewhen stdout is empty, is not JSON, or is a report rather thanErrorEnvelope | None- an envelope. Otherwise the parsed envelope.
Raises
ValueError- stdout is an envelope missing one of its frozen keys — a binary outside the tested window, not a recoverable state.