listShutdownIssues - List all issues that occur when project closes - MATLAB (original) (raw)

Main Content

List all issues that occur when project closes

Since R2025a

Syntax

Description

[projectShutdownIssues](#bu4j88bstrt-01%5Fsep%5Fbu4j88b-modifiedfiles) = listShutdownIssues([proj](#bu4j88bstrt-01%5Fsep%5Fmw%5F56667886-df27-4faf-868a-62680206145f)) returns the list of issues that occur during the project proj shutdown.

example

[projectShutdownIssues](#bu4j88bstrt-01%5Fsep%5Fbu4j88b-modifiedfiles) = listShutdownIssues([proj](#bu4j88bstrt-01%5Fsep%5Fmw%5F56667886-df27-4faf-868a-62680206145f),[Name=Value](#namevaluepairarguments)) specifies additional options using one or more name-value arguments. For example, to exclude checking issues in referenced projects, set theIncludeReferences argument tofalse.

example

Examples

collapse all

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

Get all shutdown issues in the loaded project.

close(proj); projectShutdownIssues = listShutdownIssues(proj)

projectShutdownIssues =

1×2 Issue array with properties:

ID
Details
ProblemFiles
ProjectRoot
Exception

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

firstIssue = projectShutdownIssues(1)

firstIssue =

Issue with properties:

          ID: "Project:Issues:RunMatlabCode"
     Details: ""
ProblemFiles: "C:\WorkSpace\ProjectIssuesExample\shutdownscript.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.

Determine if the project has shutdown issues caused by running MATLAB code. The ProblemFiles property lists the files that fail to run. The Details property shows that the file no longer exists on disk.

close(proj); issues = listShutdownIssues(proj,ID="Project:Issues:RunMatlabCode")

issues =

Issue with properties:

          ID: "Project:Issues:RunMatlabCode"
     Details: "Unable to find file C:\WorkSpace\ProjectIssuesExample\shutdownscript.m."
ProblemFiles: "C:\WorkSpace\ProjectIssuesExample\shutdownscript.m"
 ProjectRoot: "C:\WorkSpace\ProjectIssuesExample"
   Exception: []

Fix the shutdown issue by removing the file from the project and the shutdown tasks.

proj.reload; proj.removeFile(issues.ProblemFiles);

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 asName1=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 = listShutdownIssues(proj,IncludeReferences=false,ID="Project:Issues:RunMatlabCode") returns issues related to running MATLAB code during the top-level project shutdown.

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

Data Types: logical

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

Data Types: string | char

Output Arguments

collapse all

Project shutdown issues, returned as an array ofmatlab.Project.Issue objects.

Version History

Introduced in R2025a