Main Content

getArtifactErrors

R2026b

View errors from artifact analysis

Description

errors = getArtifactErrors(metricEngine) returns the artifact errors detected during artifact analysis. When you collect metric results, the execute function can report artifact errors. Artifacts that return errors during analysis do not produce metric results.

example

Examples

collapse all

Collect metrics for the testing artifacts in a project. Then, check if artifacts returned errors and were not analyzed.

Open the project. For this example, in the MATLAB® Command Window, enter:

openExample("slcheck/ExploreTestingMetricDataInModelTestingDashboardExample");
openProject("cc_CruiseControl");

Create a metric.Engine object for the project.

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 model testing metrics by using the execute function on the metric.Engine object.

execute(metric_engine,"modeltesting.TestAnalysis[]");

Access the errors that occurred during analysis.

getArtifactErrors(metric_engine)
ans =

  1×0 empty struct array with fields:

    URI
    ErrorId
    ErrorMessage
    Severity

For this example, the artifacts did not return errors.

Input Arguments

collapse all

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

Output Arguments

collapse all

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

  • URI — Digital thread URI of the artifact that returned the error

  • ErrorId — Identifier of the error

  • ErrorMessage — Description of the error

  • Severity — Severity of the error

Alternative Functionality

App

To view artifact issues for a Model Design or Model Testing dashboard, click Artifact Issues in the dashboard toolstrip. The Artifact Issues tab shows a table of the artifact issues in the current project. You can click on the hyperlinks in the Source column to open the affected artifact. You can also sort the artifact issues by type by clicking the Message ID column header. For more information, see View Artifact Issues in Project.

Artifacts that generate errors appear in the Errors folder in the dashboard user interface. For more information, see Artifact Errors.

Version History

Introduced in R2020b