ChronaxisUser manual中文
On this pageMembersPlanValidationErrorPlanValidationError.__init__PlanValidationError.refresh_textPlanValidationError.to_dictPlanValidationError.diagnosticsPlanValidationError.from_diagnosticsSource locations

chronaxis.PlanValidationError

Import this object from chronaxis. This page covers its directly public members and necessary construction/context protocols. See the Chinese implementation reference for internals. Return to the public API index. Check required parameters, defaults, returns, and exceptions before calling.

Members

PlanValidationError

Store a configuration field path, reason, machine-readable code, and optional source location and correction hint. It does not suppress execution or data-read failures. code distinguishes invalid configuration from capabilities not yet connected to an executable path.

python
PlanValidationError(path: str, message: str, code: str = 'invalid_config', *, hint=None, source=None, location=None, object_name=None, value=None)

Base class: ValueError.

PlanValidationError.__init__

Construct a field-specific error, preserving the original exception chain for loader diagnostics.

python
PlanValidationError.__init__(path: str, message: str, code: str='invalid_config', *, hint=None, source=None, location=None, object_name=None, value=None)
Name Type Required Default Purpose, choices, and effect
path str Yes No default Positional or keyword. Actual failing field path, such as $.signals[0].unit.
message str Yes No default Positional or keyword. Human-readable violated requirement, such as a positive integer being required. Do not include complete private input data.
code str No 'invalid_config' Positional or keyword. Machine-readable category. Classify errors by code rather than matching Chinese message text.
hint str or None No None Keyword-only correction hint, such as valid options/names. Does not modify configuration.
source str or None No None Keyword-only source file or display name, separate from field path. None when unknown.
location ConfigurationLocation or None No None Keyword-only proven original line/column. If unavailable, report only file and field rather than guessing.
object_name str or None No None Keyword-only source, signal, or node name for locating the error, not inferring names.
value str or None No None Keyword-only shortened value description. Large containers show only type/size, not the entire configuration.

Returns None; exception text contains path and reason. No documented exceptions: validators construct the arguments internally.

PlanValidationError.refresh_text

Rebuild the human-readable message after attaching location information.

python
PlanValidationError.refresh_text()

No explicit parameters. Returns None. No documented exceptions.

PlanValidationError.to_dict

Return stable machine-readable diagnostics as a native dict.

python
PlanValidationError.to_dict()

No explicit parameters. No documented exceptions.

For an aggregate error, to_dict() describes its first item. Use [item.to_dict() for item in error.diagnostics] to obtain every reported error. blocked_checks is a tuple of dictionaries with path and reason; these checks could not run because required declarations were invalid. They are not additional confirmed errors.

PlanValidationError.diagnostics

python
PlanValidationError.diagnostics

Read this property without parentheses. Returns a tuple of individual PlanValidationError objects; a single error also returns a one-item tuple. No parameters or documented exceptions.

PlanValidationError.from_diagnostics

python
PlanValidationError.from_diagnostics(errors, blocked=())

Construct an aggregate error from a nonempty sequence of individual errors and optional blocked-check dictionaries (path and reason). Returns a PlanValidationError; raises ValueError if errors is empty. A single error with no blocked checks is returned unchanged. Application code normally catches the exception produced by the plan loader instead of constructing it.

Name Type Required Default Purpose
errors Sequence[PlanValidationError] Yes No default Nonempty sequence of individual configuration errors. A single error without blocked checks is returned unchanged.
blocked Iterable[dict] No () Sequence of blocked-check dictionaries with path and reason. An empty tuple means no blocked checks were recorded.

Source locations

Chronaxis user manual · Offline edition