rebase.RebaseWorkflowError

Error raised for Rebase SDK and workflow API failures.

Signature

class rebase.RebaseWorkflowError(RuntimeError)

rebase.RebaseError is an alias for rebase.RebaseWorkflowError.

Attributes

AttributeTypeDescription
status_code`intNone`

Usage

import rebase as rb

try:
    rb.get_function("forecasting/missing-function")
except rb.RebaseWorkflowError as exc:
    print(exc)

status_code is how you tell a route this API version does not have from a genuine failure — a platform older than your toolkit answers 404 or 405 for a route it has never heard of. The SDK uses it internally to degrade gracefully rather than break a whole view: Client.list_run_tasks returns [] and Client.delete_projects falls back to one request per project.

try:
    tasks = client.list_run_tasks(run_id)
except rb.RebaseWorkflowError as exc:
    if exc.status_code in {404, 405}:
        tasks = []          # this platform has no tasks route
    else:
        raise

Response bodies are attached to the error message, so printing the exception shows the API's detail field. See Errors for what each status means.

On this page