Technical previewShare feedback

Search

Search documentation

Errors

Updated Nov 1, 2026

Every fallible call returns textlane::Error, with a code naming what went wrong and a message for people; it implements std::error::Error.

use textlane::Pipeline;

let error = Pipeline::new()
    .use_value(&serde_json::json!("md.nope"), None)
    .err()
    .ok_or("no error")?;
error.code
// unknown-plugin
CodeWhen
invalid-stagefreeze finds a stage that does not take the tree the one before returns
missing-parserparse runs with no parser in the processor
async-in-syncrun_sync meets a stage with asynchronous work
unknown-nodea compiler meets a node type it cannot write
mdx-failedmdx::Compile meets JavaScript it cannot compile
unsafe-numbernl::IndefiniteArticle meets a number too large to read
highlight-failedhtml::Highlight cannot color a code block
highlight-unavailablehtml::Highlight's grammars and themes failed to load
missing-natural-language-parserhtml::ToNaturalLanguage runs in a build without the nl feature

Pipeline adds the codes of unified's API, as the Node.js and Python packages raise them:

CodeWhen
unknown-pluginuse_value names a plugin textlane does not have
invalid-pluginuse_value gets something that is neither a plugin, a list nor a preset
invalid-optionsa plugin's options do not match its types, when the pipeline freezes
invalid-datareplace_data gets something that is not an object
frozen-processoruse_value or a data setter is called on a frozen pipeline
missing-compilerstringify or process runs with no compiler in the pipeline
invalid-treea JSON tree is not valid unist
unsupported-nodea JSON tree holds a node with no type
tree-too-deepa tree nests too deep to write as JSON

Syntax errors in MDX carry the upstream's source and rule as their code, as micromark-extension-mdx-expression:acorn for an expression that does not parse.

Created with ❤ and Livemark