---
title: "NutrientException"
canonical_url: "https://www.nutrient.io/api/python/exceptions/nutrient-exception/"
md_url: "https://www.nutrient.io/api/python/exceptions/nutrient-exception.md"
last_updated: "2026-09-02T09:34:35.870Z"
description: "Base class for all Nutrient SDK exceptions."
---

Base class for all Nutrient SDK exceptions. Every exception raised by the SDK
inherits from `NutrientException`, so catching it handles any SDK error.

```python

from nutrient_sdk import NutrientException

```

**Inherits from:** `Exception`

```python

try:
    document.export_as_pdf("output.pdf")
except NutrientException as error:
    print(error)                 # the message

    print(error.error_code)      # native error code, if any

```

## Construction

```python

NutrientException(message, error_code=None, error_source=None)

```

Creates a new `NutrientException` with the given message and optional native
error details.

## Properties

### message

```python

@property
def message(self) -> str

```

The error message.

**Type:** `str`

*Read-only property.*

---

### error_code

```python

@property
def error_code(self) -> Optional[int]

```

The native error code, if any.

**Type:** `Optional[int]`

*Read-only property.*

---

### error_source

```python

@property
def error_source(self) -> Optional[str]

```

The source location of the error, if any.

**Type:** `Optional[str]`

*Read-only property.*

## Methods

### has_native_error

```python

def has_native_error(self) -> bool

```

Returns whether native error details are attached to this exception.

**Returns:** `bool`

---

### get_native_details

```python

def get_native_details(self) -> Optional[Dict[str, Any]]

```

Returns the native error details, if any.

**Returns:** `Optional[Dict[str, Any]]`

## Inheritors

- [`AlreadyOpenForEditionException`](/api/python/exceptions/already-open-for-edition-exception/)

- [`BarcodeException`](/api/python/exceptions/barcode-exception/)

- [`ExportException`](/api/python/exceptions/export-exception/)

- [`FeatureUnLicensedException`](/api/python/exceptions/feature-un-licensed-exception/)

- [`FileNotFoundException`](/api/python/exceptions/file-not-found-exception/)

- [`ImplicitConversionException`](/api/python/exceptions/implicit-conversion-exception/)

- [`IncompatibleTypeException`](/api/python/exceptions/incompatible-type-exception/)

- [`IndexOutOfBoundsException`](/api/python/exceptions/index-out-of-bounds-exception/)

- [`InvalidArgumentException`](/api/python/exceptions/invalid-argument-exception/)

- [`InvalidLicenseException`](/api/python/exceptions/invalid-license-exception/)

- [`InvalidPasswordException`](/api/python/exceptions/invalid-password-exception/)

- [`InvalidSettingsException`](/api/python/exceptions/invalid-settings-exception/)

- [`InvalidStateException`](/api/python/exceptions/invalid-state-exception/)

- [`InvalidTemplateException`](/api/python/exceptions/invalid-template-exception/)

- [`NullOrEmptyParameterException`](/api/python/exceptions/null-or-empty-parameter-exception/)

- [`NutrientArgumentNullException`](/api/python/exceptions/nutrient-argument-null-exception/)

- [`OcrException`](/api/python/exceptions/ocr-exception/)

- [`PdfEditException`](/api/python/exceptions/pdf-edit-exception/)

- [`SdkException`](/api/python/exceptions/sdk-exception/)

- [`UnsupportedConversion`](/api/python/exceptions/unsupported-conversion/)

- [`UnsupportedFormatException`](/api/python/exceptions/unsupported-format-exception/)

- [`VisionException`](/api/python/exceptions/vision-exception/)

---

## Related pages

- [All public classes import directly from the top-level package:](/api/python/exceptions.md)
- [Already Open For Edition Exception](/api/python/exceptions/already-open-for-edition-exception.md)
- [Barcode Exception](/api/python/exceptions/barcode-exception.md)
- [Barcode Invalid Data Exception](/api/python/exceptions/barcode-invalid-data-exception.md)
- [Barcode Invalid Length Exception](/api/python/exceptions/barcode-invalid-length-exception.md)
- [Barcode Invalid Not Numeric Data Exception](/api/python/exceptions/barcode-invalid-not-numeric-data-exception.md)
- [Barcode Invalid Start Exception](/api/python/exceptions/barcode-invalid-start-exception.md)
- [Barcode Invalid Stop Exception](/api/python/exceptions/barcode-invalid-stop-exception.md)
- [Barcode Invalid Type Exception](/api/python/exceptions/barcode-invalid-type-exception.md)
- [Barcode Invalid Width Exception](/api/python/exceptions/barcode-invalid-width-exception.md)
- [Export Exception](/api/python/exceptions/export-exception.md)
- [Feature Un Licensed Exception](/api/python/exceptions/feature-un-licensed-exception.md)
- [File Not Found Exception](/api/python/exceptions/file-not-found-exception.md)
- [Implicit Conversion Exception](/api/python/exceptions/implicit-conversion-exception.md)
- [Incompatible Type Exception](/api/python/exceptions/incompatible-type-exception.md)
- [Index Out Of Bounds Exception](/api/python/exceptions/index-out-of-bounds-exception.md)
- [Invalid Argument Exception](/api/python/exceptions/invalid-argument-exception.md)
- [Invalid License Exception](/api/python/exceptions/invalid-license-exception.md)
- [Invalid Password Exception](/api/python/exceptions/invalid-password-exception.md)
- [Invalid Settings Exception](/api/python/exceptions/invalid-settings-exception.md)
- [Invalid State Exception](/api/python/exceptions/invalid-state-exception.md)
- [Invalid Template Exception](/api/python/exceptions/invalid-template-exception.md)
- [Null Or Empty Parameter Exception](/api/python/exceptions/null-or-empty-parameter-exception.md)
- [Nutrient Argument Null Exception](/api/python/exceptions/nutrient-argument-null-exception.md)
- [Ocr Exception](/api/python/exceptions/ocr-exception.md)
- [Pdf Edit Exception](/api/python/exceptions/pdf-edit-exception.md)
- [Sdk Exception](/api/python/exceptions/sdk-exception.md)
- [Unsupported Conversion](/api/python/exceptions/unsupported-conversion.md)
- [Unsupported Format Exception](/api/python/exceptions/unsupported-format-exception.md)
- [Vision Exception](/api/python/exceptions/vision-exception.md)

