MCPcopy Create free account
hub / github.com/DeepL/deepl-python / DocumentTranslationException

Class DocumentTranslationException

deepl/exceptions.py:68–90  ·  view source on GitHub ↗

Error occurred while translating document. :param message: Message describing the error that occurred. :param document_handle: The document handle of the associated document.

Source from the content-addressed store, hash-verified

66
67
68class DocumentTranslationException(DeepLException):
69 """Error occurred while translating document.
70
71 :param message: Message describing the error that occurred.
72 :param document_handle: The document handle of the associated document.
73 """
74
75 def __init__(self, message: str, document_handle: DocumentHandle):
76 super().__init__(message)
77 self.document_handle = document_handle
78
79 def __str__(self):
80 return f"{super().__str__()}, document handle: {self.document_handle}"
81
82 @property
83 def document_request(self):
84 """Deprecated, use document_handle instead."""
85 import warnings
86
87 warnings.warn(
88 "document_request is deprecated", DeprecationWarning, stacklevel=2
89 )
90 return self.document_handle
91
92
93class GlossaryNotFoundException(DeepLException):

Callers 2

translate_documentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected