ddn.odf.common
Shared error types, diagnostic model, and common constants for ddn.odf.
This module provides cross-cutting types used by all ODF submodules: typed exceptions, structured diagnostics, and severity levels.
Public-facing errors and diagnostics are re-exported through ddn.odf.
Types 9
Severity level for ODF diagnostics.
Structured diagnostic code identifying the category of an ODF problem.
Codes are grouped by subsystem: package, XML, validation, compatibility, and general errors.
A single structured diagnostic entry describing an ODF problem or information notice.
Diagnostics can be collected during parsing, validation, or serialization and reported to the caller through options rather than thrown as exceptions.
OdfSeverity severitySeverity of this diagnostic.OdfDiagnosticCode codeMachine-readable diagnostic code.string messageHuman-readable message describing the problem.string locationOptional location hint such as a package entry path or XML element name.string xmlContextOptional XML context string for XML-related diagnostics.string packageEntryOptional package entry path for package-related diagnostics.Base exception type for all ODF errors.
Carries an OdfDiagnostic so callers can access structured error details alongside the exception message.
OdfDiagnostic diagnosticThe structured diagnostic associated with this exception.this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)this(OdfDiagnostic diag, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)Thrown when an ODF package is invalid or cannot be read.
this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)this(OdfDiagnostic diag, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)Thrown when ODF XML content is malformed or invalid.
this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)this(OdfDiagnostic diag, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)Thrown when a requested feature is not yet supported.
this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)this(OdfDiagnostic diag, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)Thrown when ODF validation detects fatal conformance problems.
this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)this(OdfDiagnostic diag, string file = __FILE__, size_t line = __LINE__,
Throwable next = null)Collects ODF diagnostics during parsing, validation, or serialization.
Used in permissive workflows where problems are reported as diagnostics rather than thrown as exceptions.
private OdfDiagnostic[] _diagnosticsconst(OdfDiagnostic)[] diagnostics() @property const @safe pure nothrow @nogcReturns the collected diagnostics.size_t length() @property const @safe pure nothrow @nogcReturns the number of collected diagnostics.void add(OdfSeverity severity, OdfDiagnosticCode code, string message,
string location = "", string xmlContext = "",
string packageEntry = "") @safe pureAdds a diagnostic with explicit fields.bool hasErrors() const @safe pure nothrow @nogcReturns `true` if any diagnostic has error or fatal severity.bool hasWarnings() const @safe pure nothrow @nogcReturns `true` if any diagnostic has warning severity.