ProcessError
A ProcessError is one structured, typed entry in the errors collection of a ProcessResult. Its typed fields let callers react to a specific failure mode programmatically — retry transient failures, abort on a fatal model outage, count save failures — without parsing message strings.
You read these instances from ProcessResult.errors, directly or through its query helpers (errorsByCode, errorsByScope, retryableErrors).
Properties
| Property Name | Type | Description |
|---|---|---|
scope | Text | Where the error originated: "pipeline", "definition", "chunk", or "entity". |
severity | Text | "warning", "error", or "fatal". Determined by code (see ProcessErrorCode). |
code | Integer | Machine-readable error code — compare against the constants on ProcessErrorCode. |
ref | Variant | Scope-dependent reference: "Dataclass.vector", an entity primary key, a model alias, or Null. |
message | Text | Human-readable, localized message. |
retryable | Boolean | True when re-running the operation could plausibly succeed. Determined by code. |
scope values
| Scope | Meaning |
|---|---|
"pipeline" | Top-level failure affecting the whole run (null selection, a model became unavailable). |
"definition" | A Definition failed validation or was skipped. |
"chunk" | A whole batch (chunk) of entities failed in a single API call. |
"entity" | A single entity failed to embed or save. |
severity values
| Severity | Meaning |
|---|---|
"warning" | Non-blocking — does not make ProcessResult.success false. |
"error" | A recoverable failure scoped to one entity, chunk, or definition. Makes success false. |
"fatal" | Blocks the rest of the run (e.g. the model is unavailable). Also surfaces via hasFatal. |
Computed properties
| Property | Type | Description |
|---|---|---|
isFatal | Boolean | True when severity = "fatal". |
Functions
toObject()
toObject() : Object
Returns a plain object ({scope, severity, code, ref, message, retryable}) suitable for logging or JSON serialization.
| Argument | Type | Description |
|---|---|---|
| Function result | Object | A JSON-friendly snapshot of the error. |
Example
React to failures by type rather than by message text:
var $r:=$p.process()
If (Not($r.success))
If ($r.hasFatal)
ALERT("A model became unavailable — aborting until it recovers.")
End if
var $codes:=cs.EmbeddingStudio.ProcessErrorCode.me
var $saveFailures:=$r.errorsByCode($codes.SAVE_FAILED)
If ($saveFailures.length>0)
ALERT(String($saveFailures.length)+" entities failed to save.")
End if
// Collect entity keys worth retrying later
var $retry:=$r.retryableErrors().query("scope = :1"; "entity").extract("ref")
End if
See also
- ProcessErrorCode — the catalogue of
codevalues and their severity/retryability. - ProcessResult — owns the
errorscollection and the query helpers (errorsByCode,errorsByScope,retryableErrors). - Process — produces these errors.