Skip to content

Errors

Custom exception types for the Stash GraphQL client.

Stash GraphQL Client exceptions.

This module provides exception classes for Stash client operations: - StashError: Base exception for all Stash-related errors - StashGraphQLError: GraphQL query/validation errors - StashConnectionError: Network/connection errors - StashServerError: Server-side errors (500, 503, etc.) - StashIntegrationError: Data integration/transformation errors - StashSystemNotReadyError: System not ready (SETUP/NEEDS_MIGRATION)

Classes

StashError

StashError(*args: Any)

Bases: RuntimeError

Base exception for Stash-related errors.

This error is raised when communication with a Stash server fails or when Stash API operations encounter errors.

StashGraphQLError

StashGraphQLError(*args: Any)

Bases: StashError

Raised when a GraphQL query fails validation or execution.

This may be caused by: - Invalid GraphQL query syntax - Querying non-existent fields - GraphQL validation errors - Query execution errors

StashConnectionError

StashConnectionError(*args: Any)

Bases: StashError

Raised when connection to Stash server fails.

This may be caused by: - Network connectivity issues - Invalid Stash URL - Stash server not running - Authentication failures

StashServerError

StashServerError(*args: Any)

Bases: StashError

Raised when Stash server returns an error response.

This may be caused by: - Internal server errors (500) - Service unavailable (503) - Other server-side issues

StashIntegrationError

StashIntegrationError(*args: Any)

Bases: StashError

Raised when data integration or transformation fails.

This may be caused by: - Invalid data format from Stash API - Type conversion errors - Missing required fields - Schema version mismatches

StashSystemNotReadyError

StashSystemNotReadyError(*args: Any)

Bases: StashError

Raised when Stash system is not ready for operations.

This occurs when the system status is: - SETUP: Initial setup required - NEEDS_MIGRATION: Database migration required

StashConfigurationError

StashConfigurationError(*args: Any)

Bases: StashError

Raised when attempting to modify protected Stash configuration values.

This occurs when trying to modify critical server-side configuration that could corrupt the Stash installation, such as: - File system paths (database_path, backup_directory_path, etc.) - System paths (ffmpeg_path, ffprobe_path, etc.)

These values should only be modified through the Stash web interface or configuration file to prevent accidental corruption.

StashCleanupWarning

Bases: UserWarning

Warning emitted when Stash cleanup tracker encounters errors during cleanup.

StashUnmappedFieldWarning

Bases: UserWarning

Warning emitted when a StashObject receives fields not declared in the model.

This can happen when: - The Stash server is newer than the Python client and returned fields that haven't been mapped yet. - The Stash server is older and still sends deprecated fields that the Python client no longer declares. - A schema rename occurred between server versions.

The extra data is preserved in pydantic_extra and is safe to ignore — it just isn't accessible as typed attributes.

Unlike StashInput's DeprecationWarning (which signals upcoming enforcement of extra="forbid"), this warning is purely informational.

StashVersionError

StashVersionError(*args: Any)

Bases: StashError

Raised when the Stash server version is too old to be supported.

This occurs when the server's appSchema is below the minimum required by this client version (MIN_SUPPORTED_APP_SCHEMA = 75, i.e. Stash v0.30.0).