prefect.exceptions
Prefect-specific exceptions.
Functions
exception_traceback
Classes
PrefectException
Base exception type for Prefect errors.
CrashedRun
Raised when the result from a crashed run is retrieved.
This occurs when a string is attached to the state instead of an exception or if
the state’s data is null.
FailedRun
Raised when the result from a failed run is retrieved and an exception is not
attached.
This occurs when a string is attached to the state instead of an exception or if
the state’s data is null.
CancelledRun
Raised when the result from a cancelled run is retrieved and an exception
is not attached.
This occurs when a string is attached to the state instead of an exception
or if the state’s data is null.
PausedRun
Raised when the result from a paused run is retrieved.
UnfinishedRun
Raised when the result from a run that is not finished is retrieved.
For example, if a run is in a SCHEDULED, PENDING, CANCELLING, or RUNNING state.
MissingFlowError
Raised when a given flow name is not found in the expected script.
UnspecifiedFlowError
Raised when multiple flows are found in the expected script and no name is given.
MissingResult
Raised when a result is missing from a state; often when result persistence is
disabled and the state is retrieved from the API.
ScriptError
Raised when a script errors during evaluation while attempting to load data
ParameterTypeError
Raised when a parameter does not pass Pydantic type validation.
Methods:
from_validation_error
ParameterBindError
Raised when args and kwargs cannot be converted to parameters.
Methods:
from_bind_failure
SignatureMismatchError
Raised when parameters passed to a function do not match its signature.
Methods:
from_bad_params
ObjectNotFound
Raised when the client receives a 404 (not found) from the API.
ObjectAlreadyExists
Raised when the client receives a 409 (conflict) from the API.
ObjectLimitReached
Raised when the client receives a 403 (forbidden) from the API due to reaching an object limit (e.g. maximum number of deployments).
ObjectUnsupported
Raised when the client receives a 403 (forbidden) from the API due to an unsupported object (i.e. requires a specific Prefect Cloud tier).
UpstreamTaskError
Raised when a task relies on the result of another task but that task is not
‘COMPLETE’
MissingContextError
Raised when a method is called that requires a task or flow run context to be
active but one cannot be found.
MissingProfileError
Raised when a profile name does not exist.
ReservedArgumentError
Raised when a function used with Prefect has an argument with a name that is
reserved for a Prefect feature
InvalidNameError
Raised when a name contains characters that are not permitted.
PrefectSignal
Base type for signal-like exceptions that should never be caught by users.
Abort
Raised when the API sends an ‘ABORT’ instruction during state proposal.
Indicates that the run should exit immediately.
Pause
Raised when a flow run is PAUSED and needs to exit for resubmission.
ExternalSignal
Base type for external signal-like exceptions that should never be caught by users.
TerminationSignal
Raised when a flow run receives a termination signal.
PrefectHTTPStatusError
Raised when client receives a Response
that contains an HTTPStatusError.
Used to include API error details in the error messages that the client provides users.
Methods:
from_httpx_error
PrefectHTTPStatusError
from an httpx.HTTPStatusError
.