sandbox-failure
Import
Section titled “Import”import * as api from "@fungi.computer/mycelium/sandbox-failure";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | SourceInvalid | A location in the submitted program, never in the host’s source. |
| class | GuestThrew | Text captured inside the guest’s own exception handler. |
| class | DeadlineExceeded | The invocation owner decided its execution budget was spent. |
| class | SandboxBusy | Admission expired before any sandbox work started. |
| class | Cancelled | The invocation owner accepted cancellation. |
| class | DispatchLost | Dispatch started, but its transport did not deliver an answer. |
| class | SandboxCrashed | The sandbox process could not start or stopped before answering. |
| class | BadResponse | A received envelope could not be decoded. Its reason is operator only. |
| class | ResultTooLarge | A JSON result exceeded Mycelium’s output budget. |
| class | ResultNotJson | A result could not be represented as JSON. |
| class | CapabilityFailed | Failure at a named capability boundary, with an owner-admitted diagnostic. |
| class | Unknown | A foreign throw violated the typed adapter contract. |
| type alias | SandboxFailureReference | Optional source reference carried by sandbox failures. |
| type alias | CapabilityDiagnostic | A capability owner explicitly admits this bounded diagnostic as safe. |
| type alias | CapabilityFailureFields | Fields admitted by a capability owner, with the original cause kept private. |
| type alias | SandboxFailure | Closed error channel shared by sandbox adapters and the invocation owner. |
| function | referenceSandboxFailure() | Copy the failure to correlate one execution without mutating shared host errors. |
| function | sandboxFailureMessage() | The sole model projection. Transport, parser and raw cause fields stay private. |
SourceInvalidclass
Section titled “SourceInvalid”A location in the submitted program, never in the host’s source.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SourceInvalid(args): SourceInvalid;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; line: number; column: number; excerpt: string; } |
args.ref? |
string |
args.line |
number |
args.column |
number |
args.excerpt |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("SourceInvalid")< SandboxFailureReference & { readonly line: number; readonly column: number; readonly excerpt: string; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("SourceInvalid").ref;readonly line: number;Inherited from
Section titled “Inherited from”Data.TaggedError("SourceInvalid").line;column
Section titled “column”readonly column: number;Inherited from
Section titled “Inherited from”Data.TaggedError("SourceInvalid").column;excerpt
Section titled “excerpt”readonly excerpt: string;Inherited from
Section titled “Inherited from”Data.TaggedError("SourceInvalid").excerpt;GuestThrewclass
Section titled “GuestThrew”Text captured inside the guest’s own exception handler.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GuestThrew(args): GuestThrew;Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
args |
{ ref?: string; name: string; message: string; missingVariable?: string; transportMessage?: string; } |
- |
args.ref? |
string |
- |
args.name |
string |
- |
args.message |
string |
- |
args.missingVariable? |
string |
- |
args.transportMessage? |
string |
Safe provider envelope carried in the guest exception’s cause, never model text. |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew")< SandboxFailureReference & { readonly name: string; readonly message: string; readonly missingVariable?: string | undefined; / Safe provider envelope carried in the guest exception's cause, never model text. / readonly transportMessage?: string | undefined; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew").ref;missingVariable?
Section titled “missingVariable?”readonly optional missingVariable?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew").missingVariable;transportMessage?
Section titled “transportMessage?”readonly optional transportMessage?: string;Safe provider envelope carried in the guest exception’s cause, never model text.
Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew").transportMessage;name: string;Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew").name;message
Section titled “message”message: string;Inherited from
Section titled “Inherited from”Data.TaggedError("GuestThrew").message;DeadlineExceededclass
Section titled “DeadlineExceeded”The invocation owner decided its execution budget was spent.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DeadlineExceeded(args): DeadlineExceeded;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; limitMs: number; elapsedMs: number; acknowledged?: boolean; } |
args.ref? |
string |
args.limitMs |
number |
args.elapsedMs |
number |
args.acknowledged? |
boolean |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("DeadlineExceeded")< SandboxFailureReference & { readonly limitMs: number; readonly elapsedMs: number; readonly acknowledged?: boolean | undefined; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("DeadlineExceeded").ref;limitMs
Section titled “limitMs”readonly limitMs: number;Inherited from
Section titled “Inherited from”Data.TaggedError("DeadlineExceeded").limitMs;elapsedMs
Section titled “elapsedMs”readonly elapsedMs: number;Inherited from
Section titled “Inherited from”Data.TaggedError("DeadlineExceeded").elapsedMs;acknowledged?
Section titled “acknowledged?”readonly optional acknowledged?: boolean;Inherited from
Section titled “Inherited from”Data.TaggedError("DeadlineExceeded").acknowledged;SandboxBusyclass
Section titled “SandboxBusy”Admission expired before any sandbox work started.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SandboxBusy(args): SandboxBusy;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; capacity: number; waitedMs: number; } |
args.ref? |
string |
args.capacity |
number |
args.waitedMs |
number |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxBusy")< SandboxFailureReference & { readonly capacity: number; readonly waitedMs: number; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxBusy").ref;capacity
Section titled “capacity”readonly capacity: number;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxBusy").capacity;waitedMs
Section titled “waitedMs”readonly waitedMs: number;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxBusy").waitedMs;readonly code: "sandbox-busy" = "sandbox-busy";Stable contention code, not a sandbox health failure.
Cancelledclass
Section titled “Cancelled”The invocation owner accepted cancellation.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Cancelled(args): Cancelled;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; by: "caller" | "operator"; acknowledged?: boolean; } |
args.ref? |
string |
args.by |
"caller" | "operator" |
args.acknowledged? |
boolean |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("Cancelled")< SandboxFailureReference & { readonly by: "caller" | "operator"; readonly acknowledged?: boolean | undefined; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("Cancelled").ref;readonly by: "caller" | "operator";Inherited from
Section titled “Inherited from”Data.TaggedError("Cancelled").by;acknowledged?
Section titled “acknowledged?”readonly optional acknowledged?: boolean;Inherited from
Section titled “Inherited from”Data.TaggedError("Cancelled").acknowledged;DispatchLostclass
Section titled “DispatchLost”Dispatch started, but its transport did not deliver an answer.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DispatchLost(args): DispatchLost;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; elapsedMs: number; transport: string; errno?: string; rawCause: unknown; } |
args.ref? |
string |
args.elapsedMs |
number |
args.transport |
string |
args.errno? |
string |
args.rawCause |
unknown |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost")< SandboxFailureReference & { readonly elapsedMs: number; readonly transport: string; readonly errno?: string | undefined; readonly rawCause: unknown; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost").ref;elapsedMs
Section titled “elapsedMs”readonly elapsedMs: number;Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost").elapsedMs;transport
Section titled “transport”readonly transport: string;Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost").transport;errno?
Section titled “errno?”readonly optional errno?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost").errno;rawCause
Section titled “rawCause”readonly rawCause: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("DispatchLost").rawCause;SandboxCrashedclass
Section titled “SandboxCrashed”The sandbox process could not start or stopped before answering.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SandboxCrashed(args): SandboxCrashed;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; exit?: number; errno?: string; rawCause: unknown; } |
args.ref? |
string |
args.exit? |
number |
args.errno? |
string |
args.rawCause |
unknown |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxCrashed")< SandboxFailureReference & { readonly exit?: number | undefined; readonly errno?: string | undefined; readonly rawCause: unknown; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxCrashed").ref;readonly optional exit?: number;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxCrashed").exit;errno?
Section titled “errno?”readonly optional errno?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxCrashed").errno;rawCause
Section titled “rawCause”readonly rawCause: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("SandboxCrashed").rawCause;BadResponseclass
Section titled “BadResponse”A received envelope could not be decoded. Its reason is operator only.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BadResponse(args): BadResponse;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; reason: string; rawCause: unknown; } |
args.ref? |
string |
args.reason |
string |
args.rawCause |
unknown |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("BadResponse")< SandboxFailureReference & { readonly reason: string; readonly rawCause: unknown; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("BadResponse").ref;reason
Section titled “reason”readonly reason: string;Inherited from
Section titled “Inherited from”Data.TaggedError("BadResponse").reason;rawCause
Section titled “rawCause”readonly rawCause: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("BadResponse").rawCause;ResultTooLargeclass
Section titled “ResultTooLarge”A JSON result exceeded Mycelium’s output budget.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ResultTooLarge(args): ResultTooLarge;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; size: number; } |
args.ref? |
string |
args.size |
number |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("ResultTooLarge")< SandboxFailureReference & { readonly size: number; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("ResultTooLarge").ref;readonly size: number;Inherited from
Section titled “Inherited from”Data.TaggedError("ResultTooLarge").size;ResultNotJsonclass
Section titled “ResultNotJson”A result could not be represented as JSON.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ResultNotJson(args): ResultNotJson;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; kind: string; rawCause?: unknown; } |
args.ref? |
string |
args.kind |
string |
args.rawCause? |
unknown |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("ResultNotJson")< SandboxFailureReference & { readonly kind: string; readonly rawCause?: unknown; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("ResultNotJson").ref;readonly kind: string;Inherited from
Section titled “Inherited from”Data.TaggedError("ResultNotJson").kind;rawCause?
Section titled “rawCause?”readonly optional rawCause?: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("ResultNotJson").rawCause;CapabilityFailedclass
Section titled “CapabilityFailed”Failure at a named capability boundary, with an owner-admitted diagnostic.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<CapabilityFailureFields>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CapabilityFailed(fields): CapabilityFailed;Retain the admitted diagnostic for ordinary Error consumers through the same safe projection.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
fields |
CapabilityFailureFields |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Data.TaggedError( "CapabilityFailed",)<CapabilityFailureFields>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CapabilityFailed").ref;namespace
Section titled “namespace”readonly namespace: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CapabilityFailed").namespace;operation
Section titled “operation”readonly operation: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CapabilityFailed").operation;rawCause?
Section titled “rawCause?”readonly optional rawCause?: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("CapabilityFailed").rawCause;cause: Readonly<{ kind: "Files" | "Forage" | "InvalidInput" | "Unavailable" | "OperationFailed"; message: string;}>;Inherited from
Section titled “Inherited from”Data.TaggedError("CapabilityFailed").cause;Unknownclass
Section titled “Unknown”A foreign throw violated the typed adapter contract.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<SandboxFailureReference&object>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Unknown(args): Unknown;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ ref?: string; rawCause: unknown; } |
args.ref? |
string |
args.rawCause |
unknown |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError("Unknown")< SandboxFailureReference & { readonly rawCause: unknown; }>.constructorProperties
Section titled “Properties”readonly optional ref?: string;Inherited from
Section titled “Inherited from”Data.TaggedError("Unknown").ref;rawCause
Section titled “rawCause”readonly rawCause: unknown;Inherited from
Section titled “Inherited from”Data.TaggedError("Unknown").rawCause;SandboxFailureReferencetype alias
Section titled “SandboxFailureReference”type SandboxFailureReference = object;Optional source reference carried by sandbox failures.
Properties
Section titled “Properties”readonly optional ref?: string;CapabilityDiagnostictype alias
Section titled “CapabilityDiagnostic”type CapabilityDiagnostic = Readonly<{ kind: "Files" | "Forage" | "InvalidInput" | "Unavailable" | "OperationFailed"; message: string;}>;A capability owner explicitly admits this bounded diagnostic as safe.
CapabilityFailureFieldstype alias
Section titled “CapabilityFailureFields”type CapabilityFailureFields = object;Fields admitted by a capability owner, with the original cause kept private.
Properties
Section titled “Properties”readonly optional ref?: string;namespace
Section titled “namespace”readonly namespace: string;operation
Section titled “operation”readonly operation: string;readonly cause: CapabilityDiagnostic;rawCause?
Section titled “rawCause?”readonly optional rawCause?: unknown;SandboxFailuretype alias
Section titled “SandboxFailure”type SandboxFailure = | SourceInvalid | GuestThrew | DeadlineExceeded | SandboxBusy | Cancelled | DispatchLost | SandboxCrashed | BadResponse | ResultTooLarge | ResultNotJson | CapabilityFailed | Unknown;Closed error channel shared by sandbox adapters and the invocation owner.
referenceSandboxFailure()function
Section titled “referenceSandboxFailure()”function referenceSandboxFailure(failure, ref): SandboxFailure;Copy the failure to correlate one execution without mutating shared host errors.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
failure |
SandboxFailure |
ref |
string |
Returns
Section titled “Returns”sandboxFailureMessage()function
Section titled “sandboxFailureMessage()”function sandboxFailureMessage(failure, includeReference?): string;The sole model projection. Transport, parser and raw cause fields stay private.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
failure |
SandboxFailure |
undefined |
includeReference |
boolean |
true |
Returns
Section titled “Returns”string