error#
- nominal.experimental.extractor.decorators.error(exception_type: type[Exception], *, code: str, exit_code: int, retryable: bool = False, message: str | None = None) _ErrorMapping#
Declare a structured failure handled by the extractor runner.
Place below
@manifest_extractoror@single_file_extractor, alongside@inputand@parameter. Stack declarations for different Exception subclasses; the closest class in the raised exception’s MRO wins, regardless of decorator order. Declaring the same class twice is an error. This decorator preserves the callback’s signature.codeis a nonempty catalog error code;exit_codeis an integer from 1 through 255.retryabledescribes whether another attempt may succeed without changing the input. Codes must fit the 4,096-byte termination JSON envelope. Long messages are shortened; mapped failures retain their full traceback on stderr.Mappings cover startup, argument binding, extraction, and output finalization. They configure runtime reporting.
messageoptionally supplies static fallback text for bothExtractor.registration_kwargs()andExtractor.catalog_manifest(); when omitted, the code supplies a readable fallback truncated to 512 characters. Runtime messages come from the exception. Both exports validate and combine exit-code fallbacks.run(exit=False)and direct callback invocation propagate errors without reporting.