pub enum Code {
Show 64 variants
InvalidCharacter,
InvalidFrontMatter,
UnterminatedString,
UnterminatedExpression,
UnexpectedEof,
InvalidJsxSelfClosingTag,
UnterminatedJsxTag,
InvalidJsxClosingTag,
InvalidJsxAttribute,
UnterminatedCodeBlock,
EmptyFrontMatter,
UnterminatedLink,
UnterminatedImage,
UnterminatedInlineCode,
UnterminatedCodeBlockBlock,
UnterminatedJsxOpenTag,
UnterminatedJsxCloseTag,
UnterminatedJsxExpression,
UnterminatedMdComment,
UnterminatedFrontmatter,
MismatchedJsxCloseTag,
TableShapeMismatch,
StraySetextUnderline,
MissingJsxAttributeValue,
ListMarkerOverflow,
EmptyFrontmatter,
InvalidFrontmatterYaml,
HeadingLevelClamped,
RecoveredUnterminatedJsx,
ImportFileNotFound,
InvalidLineRange,
RegistryIndexUnreadable,
RegistryIndexMalformed,
RegistryEntryNotFound,
RegistrySourceUnreadable,
ComponentSourceUnreadable,
AssetCopyFailed,
MermaidRenderFailed,
MmdcUnavailable,
MissingComponentAttr,
AssetSourceMissing,
BaseDirNotFound,
KatexOpts,
ThemeNotBundled,
MalformedJsxTagName,
MdxTableUnsupported,
HtmlExpressionDropped,
NoRootDir,
NoConfig,
NoCollections,
CollectionNotFound,
CollectionPatternNotFound,
CollectionSchemaNotFound,
InvalidConfig,
InvalidConfigPath,
ConfigExists,
IoRead,
IoWrite,
IoCreateDir,
JsonDeserialize,
JsonSerialize,
LockPoisoned,
IoRecoverable,
Custom {
code: String,
severity: Severity,
},
}Expand description
Stable, machine-readable diagnostic identifiers spanning the whole pipeline. Codes use disjoint string namespaces per layer:
E***- lexer errors (featurelexer)W***- lexer warnings (featurelexer)P***- parser errors (featureparser)PW***- parser warnings (featureparser)T***- transform errors (featuretransform)TW***- transform warnings (featuretransform)G***- codegen errors (featurecodegen)GW***- codegen warnings (featurecodegen)C***- core / engine errors (featurecore)CW***- core / engine warnings (featurecore)S***- shared cross-cutting errors (IO, JSON, locks; always available)SW***- shared cross-cutting warnings (always available)
Custom { code, severity } is the escape hatch for third-party
transformers that want to emit through the same engine without forking
this enum.
Variants§
InvalidCharacter
E001 - Source byte the dispatcher cannot map to any token rule.
InvalidFrontMatter
E002 - Frontmatter --- opened but inner YAML is malformed.
UnterminatedString
E003 - Quoted string literal opened without a closer before EOL/EOF.
UnterminatedExpression
E004 - { ... } expression opened but brace depth never returned to zero.
UnexpectedEof
E005 - EOF reached mid-construct where more input was required.
InvalidJsxSelfClosingTag
E006 - <Tag / seen but the closing > is missing.
UnterminatedJsxTag
E007 - <Tag ... open tag never reached > or /> before a hard break/EOF.
InvalidJsxClosingTag
E008 - </Tag close tag malformed: missing name or >.
InvalidJsxAttribute
E009 - JSX attribute name= had no following value (string / {expr}).
UnterminatedCodeBlock
E010 - Fenced code block opened without an equal-length closer before EOF.
EmptyFrontMatter
W001 - Frontmatter parsed cleanly but YAML body was empty.
UnterminatedLink
P001 - [text](href) opened but ] never seen before a hard break/EOF.
UnterminatedImage
P002 -  opened but ] never seen before a hard break/EOF.
UnterminatedInlineCode
P003 - Backtick run inline never closes on the same line.
UnterminatedCodeBlockBlock
P004 - Fenced code block opened but matching ``` (or longer) never seen.
UnterminatedJsxOpenTag
P005 - <Tag ... opened but no > / /> before the next block break.
UnterminatedJsxCloseTag
P006 - </Tag opened but no > before the next block break.
UnterminatedJsxExpression
P007 - { ... } expression opened but no closing } at matching depth.
UnterminatedMdComment
P008 - {/* ... */} markdown comment opened but no */} before EOF.
UnterminatedFrontmatter
P009 - Frontmatter --- opened but no closing --- line found.
MismatchedJsxCloseTag
P010 - <Foo> close-tag name does not match the most recent open tag.
TableShapeMismatch
P011 - Table header line had N cells but alignment row had M (M != N).
StraySetextUnderline
P012 - Setext underline === / --- appeared without a preceding paragraph.
MissingJsxAttributeValue
P013 - JSX attribute appeared with = but no value (string / {expr}).
ListMarkerOverflow
P014 - List item used an ordered marker number that overflows u32.
EmptyFrontmatter
PW001 - Frontmatter parsed but YAML content was empty.
InvalidFrontmatterYaml
PW002 - YAML in frontmatter failed to parse; recovered by treating as null.
HeadingLevelClamped
PW003 - Heading level > 6 was clamped to 6.
RecoveredUnterminatedJsx
PW004 - Auto-recovery synthesised a self-close for <Tag ... to keep parsing.
ImportFileNotFound
T001 - CodeImport: file=path referenced a path that could not be read.
InvalidLineRange
T002 - CodeImport: {ranges} spec was malformed.
RegistryIndexUnreadable
T003 - ComponentPreview: registry_index JSON file failed to read.
RegistryIndexMalformed
T004 - ComponentPreview: registry_index content was not valid JSON.
RegistryEntryNotFound
T005 - ComponentPreview: requested name not found in the registry index.
RegistrySourceUnreadable
T006 - ComponentPreview: registry entry’s first file path could not be read.
ComponentSourceUnreadable
T007 - ComponentSource: path= attribute pointed to an unreadable file.
AssetCopyFailed
T008 - CopyLinkedFiles: write to assets_dir failed mid-publish.
MermaidRenderFailed
T009 - Mermaid: mmdc exited non-zero or produced no SVG.
TW001 - Mermaid: mmdc CLI is not on PATH; the transformer becomes a no-op.
MissingComponentAttr
TW002 - ComponentPreview / ComponentSource: required name / path attribute is missing.
AssetSourceMissing
TW003 - CopyLinkedFiles: a referenced asset path did not exist; original src / href preserved.
BaseDirNotFound
TW004 - CodeImport / ComponentSource: non-disk source (Origin::Stdin /
Inline / Memory) without an explicit base_dir, so relative file= /
path= paths can’t be resolved.
KatexOpts
TW006 - Math (KaTeX): katex::Opts::builder().build() failed; the
resulting renderer falls back to a no-op rendering for the affected
span. Almost always a sign of a broken build (the args are constants).
ThemeNotBundled
TW005 - PrettyCode: a configured theme name is not present in the
bundled syntect themes. Highlight falls back to the first bundled theme,
so the missing mode silently produces wrong colors. The diagnostic
lists every bundled theme so consumers can pick a valid one.
MalformedJsxTagName
G001 - Codegen encountered a JSX tag with an empty / invalid name.
MdxTableUnsupported
GW001 - MdxBodyEmitter: GFM Table node dropped (no inline table renderer
yet). Run disable-gfm first to convert tables to plain text.
HtmlExpressionDropped
GW002 - HtmlEmitter: raw JsxExpression discarded (HTML output can’t run JS);
use the MDX body emitter for full JSX support.
NoRootDir
C001 - No root dir configured.
NoConfig
C002 - No config file found.
NoCollections
C003 - No collections configured.
CollectionNotFound
C004 - Collection not found.
CollectionPatternNotFound
C005 - Collection pattern not found.
CollectionSchemaNotFound
C006 - Collection schema not found.
InvalidConfig
C007 - Invalid config.
InvalidConfigPath
C008 - Invalid config path.
ConfigExists
CW001 - Config file already exists at the target path.
IoRead
S001 - std::fs::read* / read_to_string failed at the named path.
IoWrite
S002 - std::fs::write failed at the named path.
IoCreateDir
S003 - std::fs::create_dir_all failed for the named path.
JsonDeserialize
S004 - serde_json (or other deserializer) failed to parse the input.
JsonSerialize
S005 - serde_json (or other serializer) failed to encode the value.
LockPoisoned
S006 - A Mutex / RwLock was poisoned by a panic in another thread.
IoRecoverable
SW001 - Best-effort recoverable IO miss (e.g. cache load fell through). Build continues without the cached state.
Custom
Carry an arbitrary code string + explicit severity through the same engine. For third-party transformer authors who don’t want to fork this enum. Prefer adding a typed variant when contributing upstream.