Result#

class omni.converter.dgn.Result#

Bases: pybind11_object

Conversion status and diagnostics. Warnings do not affect the status. Success does not guarantee complete or accurate output. Some conversion diagnostics appear only in the log. Getters return independent copies. Mutation methods do not validate code-specific roles or prevent duplicates.

Methods

Failure(failure)

Create a failed result and log its failure once.

__init__(self)

Create a successful result with no diagnostics.

addError(self, error)

Add and log an error, making the result incomplete unless a failure exists.

addWarning(self, warning)

Add and log a warning without changing the result status.

getErrors(self)

Return copies of the errors in a new list, in the order they were added.

getFailure(self)

Return a copy of the failure.

getStatus(self)

Return the overall result status derived from errors and failure.

getWarnings(self)

Return copies of the warnings in a new list, in the order they were added.

isFailure(self)

Return whether a failure exists, regardless of any warnings or errors.

isIncomplete(self)

Return whether errors exist without a failure, which indicates usable but incomplete output.

isSuccess(self)

Return whether no error or failure was recorded.

setFailure(self, failure)

Set or replace the failure and log it on each successful call.

__init__(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → None#

Create a successful result with no diagnostics.

static Failure(
failure: omni.converter.dgn._omni_converter_dgn.Issue,
) → omni.converter.dgn._omni_converter_dgn.Result#

Create a failed result and log its failure once.

Raises:

ValueError – If failure is an empty Issue.

addError(
self: omni.converter.dgn._omni_converter_dgn.Result,
error: omni.converter.dgn._omni_converter_dgn.Issue,
) → None#

Add and log an error, making the result incomplete unless a failure exists. An issue with code eNone is ignored without logging.

addWarning(
self: omni.converter.dgn._omni_converter_dgn.Result,
warning: omni.converter.dgn._omni_converter_dgn.Issue,
) → None#

Add and log a warning without changing the result status. An issue with code eNone is ignored without logging.

getErrors(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → List[omni.converter.dgn._omni_converter_dgn.Issue]#

Return copies of the errors in a new list, in the order they were added. Changes do not affect the result.

getFailure(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → omni.converter.dgn._omni_converter_dgn.Issue#

Return a copy of the failure. If no failure exists, return an empty Issue with hasIssue() == False, not None. Changes to the copy do not affect the result.

getStatus(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → omni.converter.dgn._omni_converter_dgn.ResultStatus#

Return the overall result status derived from errors and failure.

getWarnings(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → List[omni.converter.dgn._omni_converter_dgn.Issue]#

Return copies of the warnings in a new list, in the order they were added. Changes do not affect the result.

isFailure(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → bool#

Return whether a failure exists, regardless of any warnings or errors.

isIncomplete(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → bool#

Return whether errors exist without a failure, which indicates usable but incomplete output.

isSuccess(
self: omni.converter.dgn._omni_converter_dgn.Result,
) → bool#

Return whether no error or failure was recorded.

setFailure(
self: omni.converter.dgn._omni_converter_dgn.Result,
failure: omni.converter.dgn._omni_converter_dgn.Issue,
) → None#

Set or replace the failure and log it on each successful call. The result retains its warnings and errors.

Raises:

ValueError – If failure is an empty Issue. The result remains unchanged.