Exceptions

All dazpy exceptions inherit from DazError.

dazpy exception hierarchy. Every SDK error derives from DazError.

exception dazpy.exceptions.DazError[source]

Bases: Exception

Base class for all dazpy exceptions.

exception dazpy.exceptions.ConnectionError[source]

Bases: DazError, ConnectionError

Raised when the SDK cannot reach the DAZ Studio Script Server.

Also a builtins.ConnectionError, so a plain except ConnectionError: catches it too.

exception dazpy.exceptions.AuthenticationError(message, status_code=401, error_code='', detail='', retryable=False)[source]

Bases: DazError

Raised on HTTP 401 or 403 (bad or missing API token, or IP blocked).

status_code

HTTP response status (401 or 403).

error_code

Stable server error code when supplied (e.g. AUTH_INVALID_TOKEN, IP_NOT_WHITELISTED).

detail

Optional structured detail from the server response.

retryable

True when the server says an identical retry may succeed.

exception dazpy.exceptions.ServerResponseError(message, status_code, error_code='', detail='', retryable=False, retry_after=0.0)[source]

Bases: DazError

Raised when the Script Server rejects a protocol request.

status_code

HTTP response status.

error_code

Stable server error code when supplied.

detail

Optional structured detail from the server response.

retryable

True when the server says an identical retry may succeed (e.g. queue full, IDEMPOTENCY_KEY_IN_FLIGHT).

retry_after

Seconds from the response’s Retry-After header, or 0.0 when the server sent none.

exception dazpy.exceptions.DazBusyError(message, reason='', retry_after=2.0)[source]

Bases: DazError

Base class for transient “DAZ Studio is busy, please retry” conditions.

reason

Human-readable explanation of why the server is busy.

retry_after

Server-suggested seconds to wait before retrying.

exception dazpy.exceptions.StudioBusyError(message, reason='', retry_after=2.0)[source]

Bases: DazBusyError

Raised on HTTP 503 STUDIO_BUSY: DAZ Studio’s main thread is occupied with a scene load, save, clear, or render and cannot service the request.

exception dazpy.exceptions.ConcurrencyLimitError(message, reason='', retry_after=2.0)[source]

Bases: DazBusyError

Raised on HTTP 429 CONCURRENT_LIMIT_EXCEEDED: too many requests are already in flight against the server.

exception dazpy.exceptions.ScriptError(message, script='', request_id='', output=None)[source]

Bases: DazError

Base class for errors that originate inside a DazScript execution.

script

The DazScript source that was submitted (may be empty for file-based executions).

request_id

The server-assigned request ID, useful for log correlation.

output

Lines written to the DAZ Studio message log before the error (e.g. via print()), useful for tracing state leading up to a failure.

property diagnostic: str

Return a formatted string with line-numbered source and error details.

exception dazpy.exceptions.ScriptSyntaxError(message, script='', request_id='', output=None)[source]

Bases: ScriptError

Raised when the DazScript engine reports a parse / syntax error.

exception dazpy.exceptions.ScriptRuntimeError(message, script='', request_id='', output=None)[source]

Bases: ScriptError

Raised when a DazScript execution fails at runtime (TypeError, ReferenceError, etc.).

exception dazpy.exceptions.TimeoutError[source]

Bases: DazError, TimeoutError

Raised when an HTTP request or async poll exceeds its timeout.

Also a builtins.TimeoutError, so a plain except TimeoutError: catches it too.

exception dazpy.exceptions.NodeNotFoundError[source]

Bases: DazError

Raised when a requested scene node, bone, or skeleton cannot be found.

exception dazpy.exceptions.AmbiguousNodeError(ref, count, matches)[source]

Bases: DazError

Raised when a node reference matches more than one scene node.

Not a NodeNotFoundError: the node exists, the reference just doesn’t pick one. Retry with an elementID or a Parent/Label path.

ref

The reference that was ambiguous.

count

How many nodes matched.

matches

NodeInfo for up to the first 12 matches.

exception dazpy.exceptions.PropertyNotFoundError[source]

Bases: DazError

Raised when a node has no property matching the requested name.

exception dazpy.exceptions.AsyncExecutionError(message, request_id='')[source]

Bases: DazError

Raised when an async request fails, is cancelled, or times out while polling.

request_id

The server-assigned request ID of the failed async job.

exception dazpy.exceptions.RenderError(message, request_id='')[source]

Bases: DazError

Raised when a render job fails on the DAZ Studio side.

request_id

The server-assigned render request ID.

exception dazpy.exceptions.BatchLimitExceededError[source]

Bases: DazError

Raised by execute() (or add_operation, for the operation-count limit) when a batch would exceed its configured operation-count or generated-script-length limit.

Raised client-side before any HTTP call, so an oversized batch never reaches Studio’s main thread.

exception dazpy.exceptions.MaterialError(message, request_id='')[source]

Bases: DazError

Raised when an Iray material/surface-property operation fails.

Covers a missing material, a channel label that doesn’t resolve to a property on the live material, or a failed setValue()/setMap().

request_id

The server-assigned render request ID.

exception dazpy.exceptions.ServerVersionWarning[source]

Bases: UserWarning

Warned when the connected plugin is older than dazpy.MIN_SERVER_VERSION.

dazpy may call endpoints an older plugin doesn’t have, which then fail with opaque HTTP errors. Upgrade the DazScriptServer plugin in that Daz Studio instance, or use a dazpy release that matches the plugin. Emitted once per running plugin; the result is also available as client.version_check and through the on_version_check callback.

Silence with DazClient(check_version=False) or the standard warnings filters.

exception dazpy.exceptions.RecipeValidationError(report)[source]

Bases: DazError

Raised when a scene recipe fails offline validation.

report

The dazpy._recipe_validate.ValidationReport with every error found (path, code, message, allowed values, suggestion).

exception dazpy.exceptions.SceneCheckError(report)[source]

Bases: DazError

Raised when a pre-render scene check required to be clean found errors.

Raised by dazpy.recipe.render(..., require_clean=True).

report

The dazpy.CheckReport with every finding.

exception dazpy.exceptions.RecipeNotAppliedError(message, report)[source]

Bases: DazError

Raised by dazpy.recipe.render when the scene does not match the recipe.

report

The dazpy.recipe.ObserveReport that caused the refusal.