TPLWorkflowJSONError
Native Pascal, workflow preparation
Description
TPLWorkflowJSONError receives the diagnostics of a failed PLParseWorkflowJSONEx call. The parser fills the position of the character it stopped at, the matching line and column, whether a configured budget was exhausted, and a human-readable message.
The record is written on every call; on success all numeric fields are zero and MessageText is empty, so test the Boolean result first.
Syntax
Delphi
TPLWorkflowJSONError = Record
Position, Line, Column: Integer;
BudgetExceeded: Boolean;
MessageText: WideString;
End;Fields
| Position | One-based UTF-16 character offset where parsing stopped, clamped to 1 through Length(Source)+1 |
|---|---|
| Line | One-based line number derived from Position; a lone CR, a lone LF and a CRLF pair each count as one line break |
| Column | One-based UTF-16 column derived from Position |
| BudgetExceeded | True when the source length, nesting depth, node count or container item limit was reached; False for syntax errors and invalid options |
| MessageText | Human-readable parser message; empty on success |
Remarks
Position may point one past the last character when the input ended before the value was complete.
BudgetExceeded distinguishes an exhausted capacity limit from malformed input, which is useful when a caller can retry with larger budgets.
MessageText is diagnostic text for logs and UI messages, not a stable error code; use the numeric fields to classify the failure.