Interface: NubbinIssue
Defined in: packages/core/src/nubbinIssue.types.ts:26
One reason Nubbin refused something. The shape every refusal takes, whether it arrives thrown
inside a NubbinError or returned in CompileResult.issues, so a consumer writes one handler
and serializes one thing.
It is plain JSON: safe to log, store, or send across a wire without reshaping.
Example
Turn an issue into an editor selection
function reveal(issue: NubbinIssue): void {
if (issue.at !== undefined) editor.select(issue.at);
if (issue.path !== undefined) editor.highlightField(issue.path);
editor.explain(issue.message);
}
Properties
at?
optionalat?:string
Defined in: packages/core/src/nubbinIssue.types.ts:35
What it concerns: a node id, a block name, or a route. Absent when nothing names it.
code
code:
NubbinIssueCode
Defined in: packages/core/src/nubbinIssue.types.ts:31
Which refusal this is. Branch on it against NubbinIssueCode — never on message, which is
prose and is reworded whenever a clearer wording is found.
message
message:
string
Defined in: packages/core/src/nubbinIssue.types.ts:33
Prose for a person, naming the specific value or id at fault. Not a stable contract.
path?
optionalpath?:string
Defined in: packages/core/src/nubbinIssue.types.ts:40
Where within that: a dotted prop path, slots.items, or block. Absent when the whole
subject is at fault rather than one place inside it.