Exceptions#

Exception classes for litestar-vite error handling.

All exceptions inherit from the base LitestarViteError class for easy catching of library-specific errors.

Available Exceptions#

LitestarViteError

Base exception for all litestar-vite errors.

MissingDependencyError

Raised when a required package is not installed (e.g., fsspec for deployment).

ViteExecutableNotFoundError

Raised when the Vite executable cannot be found.

ViteExecutionError

Raised when Vite command execution fails.

ViteProcessError

Raised when the Vite dev server process fails to start or stop.

ManifestNotFoundError

Raised when the Vite manifest file is not found at the expected location.

AssetNotFoundError

Raised when a requested asset is not found in the manifest.

Litestar-Vite exception classes.

exception litestar_vite.exceptions.AssetNotFoundError[source]#

Bases: LitestarViteError

Raised when an asset is not found in the manifest.

__init__(file_path: str, manifest_path: str | None = None) None[source]#

Initialize the exception.

Parameters:
  • file_path – The asset path that was requested.

  • manifest_path – Path of the manifest searched. Kept out of the message so filesystem paths do not leak into error pages; exposed as an attribute.

exception litestar_vite.exceptions.LitestarViteError[source]#

Bases: Exception

Base exception for Litestar-Vite related errors.

exception litestar_vite.exceptions.ManifestNotFoundError[source]#

Bases: LitestarViteError

Raised when the manifest file is not found.

__init__(manifest_path: str | None = None) None[source]#

Initialize the exception.

Parameters:

manifest_path – Path the manifest was searched for. Kept out of the message so filesystem paths do not leak into error pages; exposed as an attribute.

exception litestar_vite.exceptions.MissingDependencyError[source]#

Bases: LitestarViteError, ImportError

Raised when a package is not installed but required.

__init__(package: str, extra: str | None = None) None[source]#

Initialize the exception.

Parameters:
  • package – PyPI distribution name of the missing package (e.g. "jinja2").

  • extra – Optional litestar-vite extra providing package (e.g. "jinja"). When omitted, only the direct install hint is shown.

exception litestar_vite.exceptions.ViteExecutableNotFoundError[source]#

Bases: LitestarViteError

Raised when the vite executable is not found.

__init__(executable: str) None[source]#
exception litestar_vite.exceptions.ViteExecutionError[source]#

Bases: LitestarViteError

Raised when the vite execution fails.

__init__(command: list[str], return_code: int, stderr: str) None[source]#
exception litestar_vite.exceptions.ViteProcessError[source]#

Bases: LitestarViteError

Raised when the Vite process fails to start or stop.

__init__(message: str, command: list[str] | None = None, exit_code: int | None = None, stderr: str | None = None, stdout: str | None = None) None[source]#