Technical previewShare feedback

Search

Search documentation

Errors

Updated Nov 1, 2026

Textlane raises textlane.TextlaneError, whose code names what went wrong, so a caller can tell the cases apart without reading the message:

import textlane

code = ""
try:
    textlane.textlane().use("md.nope")
except textlane.TextlaneError as error:
    code = error.code
code
# unknown-plugin
CodeWhen
unknown-pluginuse names a plugin textlane does not have
invalid-pluginuse 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 is built
frozen-processoruse or a data setter is called on a frozen processor
missing-parserparse or process runs with no parser in the pipeline
missing-compilerstringify or process runs with no compiler in the pipeline
invalid-stagea stage gets a tree it does not take, such as hast before md.to_html
async-in-syncprocess or run meets a stage with asynchronous work
invalid-treea tree given to run or stringify is not valid unist
unsupported-nodea tree given to run or stringify holds a node with no type
unknown-nodea compiler meets a node type it cannot write
tree-too-deepa tree nests too deep to pass between Rust and Python
mdx-failedmdx.compile meets JavaScript it cannot compile
unsafe-numbernl.indefinite_article 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

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.

Options are checked when the pipeline is built, the first time it runs or freezes, not when use is called.

Created with ❤ and Livemark