---
title: "BarcodeInvalidWidthException"
canonical_url: "https://www.nutrient.io/api/python/exceptions/barcode-invalid-width-exception/"
md_url: "https://www.nutrient.io/api/python/exceptions/barcode-invalid-width-exception.md"
last_updated: "2026-06-08T15:36:24.739Z"
description: "Represents an exception that is thrown when a barcode cannot be written due to an invalid provided width."
---

Represents an exception that is thrown when a barcode cannot be written due to an invalid provided width.

This exception is typically thrown when the provided width is causing the bars/spaces to be less than one pixel. It applies only when writing to an image.

```python

from nutrient_sdk import BarcodeInvalidWidthException

```

**Inherits from:** [`BarcodeException`](/api/python/exceptions/barcode-exception/)

## Construction

```python

BarcodeInvalidWidthException()

```

Creates a new `BarcodeInvalidWidthException` instance with default settings.

## Properties

### exception_reason

```python

@property
def exception_reason(self) -> str

```

The reason for the exception that occurs when the barcode cannot be written.

**Type:** `str`

*Read-only property.*

---

---

## Related pages

- [Barcode Exception](/api/python/exceptions/barcode-exception.md)
- [Already Open For Edition Exception](/api/python/exceptions/already-open-for-edition-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)
- [Export Exception](/api/python/exceptions/export-exception.md)
- [Implicit Conversion Exception](/api/python/exceptions/implicit-conversion-exception.md)
- [File Not Found Exception](/api/python/exceptions/file-not-found-exception.md)
- [Incompatible Type Exception](/api/python/exceptions/incompatible-type-exception.md)
- [Feature Un Licensed Exception](/api/python/exceptions/feature-un-licensed-exception.md)
- [All public classes import directly from the top-level package:](/api/python/exceptions.md)
- [Invalid Argument Exception](/api/python/exceptions/invalid-argument-exception.md)
- [Invalid License Exception](/api/python/exceptions/invalid-license-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)
- [Nutrient Argument Null Exception](/api/python/exceptions/nutrient-argument-null-exception.md)
- [Index Out Of Bounds Exception](/api/python/exceptions/index-out-of-bounds-exception.md)
- [Sdk Exception](/api/python/exceptions/sdk-exception.md)
- [Vision Exception](/api/python/exceptions/vision-exception.md)
- [Null Or Empty Parameter Exception](/api/python/exceptions/null-or-empty-parameter-exception.md)
- [Unsupported Conversion](/api/python/exceptions/unsupported-conversion.md)

