Main Content

listStartupIssues

List all issues that occur when project opens

Since R2025a

Description

projectStartupIssues = listStartupIssues(proj) returns the list of issues that occur during the project proj startup.

example

projectStartupIssues = listStartupIssues(proj,Name=Value) specifies additional options using one or more name-value arguments. For example, to exclude checking issues in referenced projects, set the IncludeReferences argument to false.

example

Examples

collapse all

Use currentProject to create a project object from the currently loaded project.

proj = currentProject;

Get all startup issues in the loaded project.

projectStartupIssues = listStartupIssues(proj)
projectStartupIssues =

  1×2 Issue array with properties:

    ID
    Details
    ProblemFiles
    ProjectRoot
    Exception

Find information about the first project startup issue. The issue occurs when the project attempts to run MATLAB® code on startup.

firstIssue = projectStartupIssues(1)
firstIssue =

  Issue with properties:

              ID: "Project:Issues:RunMatlabCode"
         Details: ""
    ProblemFiles: "C:\WorkSpace\ProjectIssuesExample\startupscript.m"
     ProjectRoot: "C:\WorkSpace\ProjectIssuesExample"
       Exception: [1×1 MException]

Find information about the error that the MException object stores.

exceptionInfo = firstIssue.Exception
exceptionInfo =

  MException with properties:

    identifier: 'shared_cmlink:git:RepositoryNotFound'
       message: ''C:\WorkSpace\ProjectIssuesExample' is not inside a Git repository.'
         cause: {}
         stack: [4×1 struct]
    Correction: []

Use currentProject to create a project object from the currently loaded project.

proj = currentProject;

Determine if the project has startup issues due to shadowed files. The ProblemFiles property lists the files that shadow files in the project.

issues = listStartupIssues(proj,ID="Project:Issues:ShadowingFile")
issues = 

  Issue with properties:

              ID: "Project:Issues:ShadowingFile"
         Details: "1 model shadowed by:"
    ProblemFiles: "C:\WorkSpace\topLevelModel.slx"
     ProjectRoot: "C:\WorkSpace\ProjectIssuesExample"
       Exception: []

Fix the startup issue by closing the shadowing files.

shadowingFiles = issues.ProblemFiles;
for idx = 1:length(shadowingFiles)
    close_system(shadowingFiles(idx));
end

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: issues = listStartupIssues(proj,IncludeReferences=false,ID="Project:Issues:RunMatlabCode") returns issues related to running MATLAB code during the top-level project startup.

Option to include issues in referenced projects, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Project issue identifier, specified as a string or character vector.

Data Types: string | char

Output Arguments

collapse all

Project startup issues, returned as an array of matlab.Project.Issue objects.

Version History

Introduced in R2025a