Main Content

getArtifactErrors

Return errors that occurred during metric execution

Description

example

errors = getArtifactErrors(metricEngine) returns the errors that occur when the metricEngine analyzes the Simulink® models. The metricEngine object does not collect results for artifacts that return errors during analysis.

Examples

collapse all

Collect design cost metrics for artifacts in a project. Then, check if artifacts return errors and were not analyzed.

To open the project, enter this command.

dashboardCCProjectStart

Create a metric.Engine object.

metric_engine = metric.Engine();

Update the trace information for metric_engine to ensure that the artifact information is up to date.

updateArtifacts(metric_engine)

Collect results for the design cost metrics by using the execute function on the metric.Engine object.

execute(metric_engine,{'DataSegmentEstimate','OperatorCount'});

Access the errors that occurred during analysis.

getArtifactErrors(metric_engine)
ans = 

  0×0 empty struct array with fields:

    Address
    UUID
    ErrorId
    ErrorMessage

For this example, the artifacts did not return errors.

Input Arguments

collapse all

Metric engine object to check for errors, specified as a metric.Engine object.

Output Arguments

collapse all

Artifact errors that occur when metric.Engine object is executed, returned as an array of structures that correspond to the errors. The structure for an error contains these fields:

  • Address — Address of artifact that returns the error

  • UUID — Unique identifier of artifact

  • ErrorID — Identifier of error

  • ErrorMessage — Description of error

Version History

Introduced in R2022a