mapres defines three exception classes in a single hierarchy. All exceptions inherit fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/mapres/llms.txt
Use this file to discover all available pages before exploring further.
MapResError, which itself inherits from Python’s built-in Exception. This structure lets you catch resolution errors at varying levels of specificity — from a targeted handler for missing placeholders, all the way to a broad catch-all for any mapres failure.
Exception hierarchy
MapResError
MapResError is the base exception class for all mapres resolution failures. It is raised directly for any error not covered by the more specific subclasses — for example, unhandled exceptions propagating out of pipeline stages or unexpected internal errors. When catching resolution errors generically, catching MapResError is sufficient.
MissingKeyError
MissingKeyError is raised when the resolver encounters a placeholder token in the input string whose key cannot be found in any registered layer, syntax provider, or context dictionary passed at resolution time. It inherits directly from MapResError.
{name} or <color> appears in the string being resolved, but no layer, context dict, or provider supplies a value for that key.
Message formats:
MapSyntaxError
MapSyntaxError is raised when a regular expression error occurs while processing a syntax pattern or during a pipeline stage. This can happen if a custom syntax pattern passed to DataMap or a pipeline step contains an invalid regex. It inherits directly from MapResError.
Catching exceptions
All three classes are importable frommapres.exceptions: