# Debugging Tools

# Functions

top-level functions:                                                                                                                                                       


(obj, raise_on_error=False)[source]

Checks whether a given object can be registered with Prefect Cloud. This requires that the object can be serialized in the current process and deserialized in a fresh process.


  • obj (Any): the object to check
  • raise_on_error(bool, optional): if True, raises the CalledProcessError for inspection; the output attribute of this exception can contain useful information about why the object is not registrable
  • bool: True if registrable, False otherwise
  • subprocess.CalledProcessError: if raise_on_error=True and the object is not registrable



Context manager for raising exceptions when they occur instead of trapping them. Intended to be used only for local debugging and testing.


    from prefect import Flow, task
from prefect.utilities.debug import raise_on_exception

def div(x):
return 1 / x

with Flow("My Flow") as f:
res = div(0)

with raise_on_exception():
f.run() # raises ZeroDivisionError

This documentation was auto-generated from commit ffa9a6c
on February 1, 2023 at 18:44 UTC