Renamed exception.

This commit is contained in:
Adam Fourney 2025-02-28 08:55:34 -08:00
parent 9a19fdd134
commit 2af4ba861c
2 changed files with 10 additions and 9 deletions

View file

@ -6,7 +6,7 @@ from .__about__ import __version__
from ._markitdown import MarkItDown from ._markitdown import MarkItDown
from ._exceptions import ( from ._exceptions import (
MarkItDownException, MarkItDownException,
ConverterPrerequisiteException, MissingOptionalDependencyException,
FileConversionException, FileConversionException,
UnsupportedFormatException, UnsupportedFormatException,
) )
@ -18,7 +18,7 @@ __all__ = [
"DocumentConverter", "DocumentConverter",
"DocumentConverterResult", "DocumentConverterResult",
"MarkItDownException", "MarkItDownException",
"ConverterPrerequisiteException", "MissingOptionalDependencyException",
"FileConversionException", "FileConversionException",
"UnsupportedFormatException", "UnsupportedFormatException",
] ]

View file

@ -6,15 +6,16 @@ class MarkItDownException(BaseException):
pass pass
class ConverterPrerequisiteException(MarkItDownException): class MissingOptionalDependencyException(MarkItDownException):
""" """
Thrown when instantiating a DocumentConverter in cases where Converters shipped with MarkItDown may depend on optional
a required library or dependency is not installed, an API key dependencies. This exception is thrown when a converter's
is not set, or some other prerequisite is not met. convert() method is called, but the required dependency is not
installed. This is not necessarily a fatal error, as the converter
will simply be skipped (an error will bubble up only if no other
suitable converter is found).
This is not necessarily a fatal error. If thrown during Error messages should clearly indicate which dependency is missing.
MarkItDown's plugin loading phase, the converter will simply be
skipped, and a warning will be issued.
""" """
pass pass