Saltar para o conteúdo principal
Versão: Próximo

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 NameTypeDescription
scopeTextWhere the error originated: "pipeline", "definition", "chunk", or "entity".
severityText"warning", "error", or "fatal". Determined by code (see ProcessErrorCode).
codeIntegerMachine-readable error code — compare against the constants on ProcessErrorCode.
refVariantScope-dependent reference: "Dataclass.vector", an entity primary key, a model alias, or Null.
messageTextHuman-readable, localized message.
retryableBooleanTrue when re-running the operation could plausibly succeed. Determined by code.

scope values​

ScopeMeaning
"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​

SeverityMeaning
"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​

PropertyTypeDescription
isFatalBooleanTrue when severity = "fatal".

Functions​

toObject()​

toObject() : Object

Returns a plain object ({scope, severity, code, ref, message, retryable}) suitable for logging or JSON serialization.

ArgumentTypeDescription
Function resultObjectA 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 code values and their severity/retryability.
  • ProcessResult — owns the errors collection and the query helpers (errorsByCode, errorsByScope, retryableErrors).
  • Process — produces these errors.