inspector/problems#
Classes#
ProblemError#
Defined in: editor/src/inspector/problems.ts:74
Thrown inside a recursive reader, caught at its boundary and returned as a result.
Extends#
Error
Constructors#
Constructor#
new ProblemError(
problem):ProblemError
Defined in: editor/src/inspector/problems.ts:77
Parameters#
problem#
Returns#
Overrides#
Error.constructor
Properties#
problem#
readonlyproblem:InspectorProblem
Defined in: editor/src/inspector/problems.ts:75
Interfaces#
InspectorProblem#
Defined in: editor/src/inspector/problems.ts:23
A problem with its path into the manifest, plus the 1-based line and column of the text for a syntax error. Command refusals keep core’s codes.
Properties#
code#
readonlycode:ErrorCode|"syntax_error"|"not_representable"|"hidden_member"
Defined in: editor/src/inspector/problems.ts:24
column?#
readonlyoptionalcolumn?:number
Defined in: editor/src/inspector/problems.ts:28
line?#
readonlyoptionalline?:number
Defined in: editor/src/inspector/problems.ts:27
message#
readonlymessage:string
Defined in: editor/src/inspector/problems.ts:25
path#
readonlypath: readonlyPathSegment[]
Defined in: editor/src/inspector/problems.ts:26
Type Aliases#
Result#
Result<
T> = {ok:true;value:T; } | {ok:false;problems: readonlyInspectorProblem[]; }
Defined in: editor/src/inspector/problems.ts:32
A value, or every problem that kept it from being read.
Type Parameters#
T#
T
Variables#
InspectorCode#
constInspectorCode:object
Defined in: editor/src/inspector/problems.ts:6
The inspector’s own problem codes, beside those of core’s command refusals.
Type Declaration#
invalidValue#
readonlyinvalidValue:"invalid_value"="invalid_value"
A value without a JSON form, such as a TOML date.
nonFiniteNumber#
readonlynonFiniteNumber:"non_finite_number"="non_finite_number"
A number that is infinite or not a number.
notRepresentable#
readonlynotRepresentable:"not_representable"="not_representable"
A value the chosen text format cannot show (a null TOML cannot omit).
syntaxError#
readonlysyntaxError:"syntax_error"="syntax_error"
The text is not valid JSON, YAML or TOML; the problem carries a line and column.
Functions#
catching()#
catching<
T>(read):Result<T>
Defined in: editor/src/inspector/problems.ts:84
read()’s value, or its thrown ProblemError as a failed result.
Type Parameters#
T#
T
Parameters#
read#
() => T
Returns#
Result<T>
problemPlace()#
problemPlace(
problem): {position:string; } | {pointer:string|null; }
Defined in: editor/src/inspector/problems.ts:48
Where a problem lies, as a list of problems shows it: a syntax error’s
line and column (line 3, column 7, or line 3), else the JSON pointer
of its member, null for the top level.
Parameters#
problem#
Pick<InspectorProblem, "path" | "line" | "column">
Returns#
{ position: string; } | { pointer: string | null; }
problemPointer()#
problemPointer(
problem):string
Defined in: editor/src/inspector/problems.ts:37
A problem’s path as a JSON pointer (RFC 6901; "" for the whole text).
Parameters#
problem#
Pick<InspectorProblem, "path">
Returns#
string
refused()#
refused(
code,message,path?,position?):object
Defined in: editor/src/inspector/problems.ts:64
The failed result of one problem.
Parameters#
code#
ErrorCode | "syntax_error" | "not_representable" | "hidden_member"
message#
string
path?#
readonly PathSegment[] = []
position?#
{ column: number; line: number; } | null = null
Returns#
object
ok#
readonlyok:false
problems#
readonlyproblems: readonlyInspectorProblem[]