Python
Diagnostic
Diagnostic class and public members in the unified Python API.Class: Diagnostic
Python · dataclassSince v0.10.0
Diagnosticfrozen=TrueImmutable copy of native diagnostic fields, available as error.diagnostic. The present bitmask identifies which native detail sections are supplied; zero or empty defaults must not be mistaken for observed details.
Creation and access
Internal constructor — do not call. Snapshot read from MaelysDatalogError.diagnostic; direct construction does not describe a native failure.
- read from
error.diagnosticRead the copied native diagnostic from a caught operation error.
Fields
sourceintpropertyDefault: 0
Native diagnostic source identifier.
statusintpropertyDefault: 0
Native operation status copied into the diagnostic.
codeintpropertyDefault: 0
Diagnostic reason code, distinct from the operation status.
presentintpropertyDefault: 0
Bitmask of supplied diagnostic detail sections.
lineintpropertyDefault: 0
Source line when location information is supplied.
columnintpropertyDefault: 0
Source column when location information is supplied.
phasestrpropertyDefault: ''
Operation phase reported by the engine.
messagestrpropertyDefault: ''
Human-readable diagnostic detail.
hintstrpropertyDefault: ''
Suggested corrective action when supplied.
filestrpropertyDefault: ''
Source or manifest path when supplied.
predicatestrpropertyDefault: ''
Predicate associated with the error.
arityintpropertyDefault: 0
Associated predicate arity.
observed_ countintpropertyDefault: 0
Observed count for a supplied capacity diagnostic.
limitintpropertyDefault: 0
Capacity bound for that diagnostic.
depthintpropertyDefault: 0
Observed depth when depth information is supplied.
depth_ limitintpropertyDefault: 0
Depth bound when supplied.
rule_ idintpropertyDefault: 0
Associated rule identifier when supplied.
comparison_ resultintpropertyDefault: 0
Reported comparison result when comparison details are supplied.
expected_ kindintpropertyDefault: 0
Expected term kind when type details are supplied.
lhs_ kindintpropertyDefault: 0
Kind of the left comparison operand.
rhs_ kindintpropertyDefault: 0
Kind of the right comparison operand.
comparison_ opintpropertyDefault: 0
Native comparison operator identifier.
limit_ kindintpropertyDefault: 0
Identifier of the capacity that was exceeded.
term_ indexintpropertyDefault: 0
Associated term position when supplied.
expected_ arityintpropertyDefault: 0
Expected predicate arity.
observed_ arityintpropertyDefault: 0
Observed argument count.
tokenstrpropertyDefault: ''
Token associated with the error.
fieldstrpropertyDefault: ''
Manifest or declaration field associated with the error.
domainstrpropertyDefault: ''
Domain associated with the error.
limit_ namestr | NoneSince v0.23.0readonly propertyDefault: —
Stable native budget name, or None when the identifier is unknown.
try:
ruleset = engine.load_manifest("policies/manifest.json")
except MaelysDatalogError as error:
detail = error.diagnostic
print("phase:", detail.phase)
print("message:", detail.message)
print("hint:", detail.hint)
print("file:", detail.file)phase: manifest message: manifest file not found hint: ensure the manifest path exists file: policies/manifest.json