Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostics

Methods to check the open packs for problems.

The server keeps the results of the last check, so clients get a summary when running it, and read the results they need with ListDiagnostics.

diagnostics.run

Checks the open packs for problems, keeping the results for diagnostics.list.

A running check stops when other requests arrive, and is queued again behind them. A new check replaces the one that hasn’t ended yet, which ends cancelled, and also checks the paths the replaced one would have checked.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (RunDiagnostics)

NameTypeRequiredDescription
pathsarray of stringno, default []If set, only files and folders of the open packs at these paths are checked again, keeping the results of the last check for the rest. If not set, or if there are no previous results, everything is checked.
ignored_typesarray of stringno, default []Report types to skip, like OutdatedTable or InvalidReference.
check_assembly_kit_only_referencesbooleanno, default falseIf references to tables only in the Assembly Kit are checked too.

Result (DiagnosticsSummary)

NameTypeRequiredDescription
totalintegeryesAmount of results.
by_levelmap of integeryesAmount of results of each level.
by_typemap of integeryesAmount of results of each report type.

diagnostics.list

Returns results of the last check, optionally filtered.

Params (ListDiagnostics)

NameTypeRequiredDescription
levelsarray of DiagnosticLevel or nullnoIf set, only results of these levels are returned.
report_typesarray of string or nullnoIf set, only results of these report types are returned.
packstring or nullnoIf set, only results of this pack are returned.
path_prefixstringno, default ""Only results of files whose path starts with this are returned.
offsetintegerno, default 0Amount of matching results to skip.
limitinteger or nullnoMaximum amount of results to return. Defaults to 100.

Result (DiagnosticList)

NameTypeRequiredDescription
resultsarray of DiagnosticResultyesThe results in the page.
totalintegeryesAmount of results matching the request, in all pages.

diagnostics.report

Returns the results of the last diagnostics check, as the check returns them.

Meant for clients showing the results with all their details. Others should use diagnostics.list.

Params (GetDiagnosticsReport)

Empty object: {}.

Result (Diagnostics)

One of RPFM’s own types, without a schema. See its docs in rpfm_lib or rpfm_extensions.

diagnostics.ignore

Makes the next checks of a pack skip some results. Saved in the pack’s settings.

Params (IgnoreDiagnostics)

NameTypeRequiredDescription
packstringyesKey of the pack.
pathstringyesFiles whose path starts with this are affected.
columnsarray of stringno, default []If set, only these columns of the files are affected.
report_typesarray of stringno, default []If set, only these report types are skipped. Otherwise, everything is skipped.

Result (Done)

Empty object: {}.

Types

Type DiagnosticLevel

Severity of a result.

One of:

  • "info": A suggestion, or information about the mod.
  • "warning": Something that may be a mistake, or cause problems in some situations.
  • "error": Something that will likely cause problems, like invalid references or malformed data.

Type DiagnosticResult

A problem found in a check.

NameTypeRequiredDescription
packstringyesKey of the pack with the problem. Empty for problems of the configuration.
pathstringyesPath of the file with the problem. Empty for problems of a whole pack or of the configuration.
checkedstringyesWhat was checked: db, loc, text, pack, config, dependency, portrait_settings, group_formations or anim_fragment_battle.
report_typestringyesType of the problem, like InvalidReference. Used to ignore it.
levelDiagnosticLevelyesSeverity of the problem.
messagestringyesDescription of the problem.
cellsarray of array of integernoTable cells with the problem, as [row, column]. -1 means the whole row or column.
columnsarray of stringnoNames of the columns of the cells with the problem.