NutrientException
Base class for all Nutrient SDK exceptions. Every exception raised by the SDK inherits from NutrientException, so catching it handles any SDK error.
from nutrient_sdk import NutrientExceptionInherits from: Exception
try: document.export_as_pdf("output.pdf")except NutrientException as error: print(error) # the message print(error.error_code) # native error code, if anyConstruction
NutrientException(message, error_code=None, error_source=None)Creates a new NutrientException with the given message and optional native error details.
Properties
message
@propertydef message(self) -> strThe error message.
Type: str
Read-only property.
error_code
@propertydef error_code(self) -> Optional[int]The native error code, if any.
Type: Optional[int]
Read-only property.
error_source
@propertydef error_source(self) -> Optional[str]The source location of the error, if any.
Type: Optional[str]
Read-only property.
Methods
has_native_error
def has_native_error(self) -> boolReturns whether native error details are attached to this exception.
Returns: bool
get_native_details
def get_native_details(self) -> Optional[Dict[str, Any]]Returns the native error details, if any.
Returns: Optional[Dict[str, Any]]
Inheritors
AlreadyOpenForEditionExceptionBarcodeExceptionExportExceptionFeatureUnLicensedExceptionFileNotFoundExceptionImplicitConversionExceptionIncompatibleTypeExceptionIndexOutOfBoundsExceptionInvalidArgumentExceptionInvalidLicenseExceptionInvalidPasswordExceptionInvalidSettingsExceptionInvalidStateExceptionInvalidTemplateExceptionNullOrEmptyParameterExceptionNutrientArgumentNullExceptionOcrExceptionPdfEditExceptionSdkExceptionUnsupportedConversionUnsupportedFormatExceptionVisionException