Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 841 Bytes

Exceptions

The Runway Model SDK defines several custom exception types. All of these exceptions derive from the base RunwayError class, which itself derives from the standard Python Exception class. Each RunwayError contains error message and code properties, and a to_response() method that converts the exception to a Python dictionary, which can be returned as a JSON HTTP response.

try:
    do_something_with_runway()
except RunwayError as e:
    print(e.code, e.message)
    # 500 An unknown error has occurred
    print(e.to_response())
    # { "error": "An unknown error has occurred", "traceback": "..." }

Reference

.. automodule:: runway.exceptions
    :members:
    :inherited-members:
    :member-order: bysource
    :exclude-members: with_traceback
    :show-inheritance:
You can’t perform that action at this time.