buffalo_core.diagnostics.OperationResult

class buffalo_core.diagnostics.OperationResult(value, diagnostics)[source]

Bases: Generic

Return one value together with structured diagnostics.

Notes

This type is useful for workflows that should return a usable value while still exposing warnings, informational messages, or recoverable issues to the caller.

Attributes

value

Primary workflow return value.

diagnostics

Structured diagnostics emitted while producing value.

has_errors

Return whether attached diagnostics contain errors.

has_infos

Return whether attached diagnostics contain infos.

has_warnings

Return whether attached diagnostics contain warnings.

value: T

Primary workflow return value.

diagnostics: DiagnosticReport

Structured diagnostics emitted while producing value.

property has_errors: bool

Return whether attached diagnostics contain errors.

property has_warnings: bool

Return whether attached diagnostics contain warnings.

property has_infos: bool

Return whether attached diagnostics contain infos.