Skip to content

Change Scheduler.delete() to return bool or raise instead of bool | Exception #119

Description

@rushilsrivastava

Scheduler.delete() and AsyncScheduler.delete() currently return bool | Exception — the exception is returned as a value rather than raised, so callers can't handle failures idiomatically and type checkers can't help.

Proposal: return bool (True if deleted, False if the job didn't exist) and raise on unexpected errors, or raise a specific library exception instead of the current blanket except Exception.

This is a breaking API change, so it should land with the next breaking-version bump. Deferred from #117 to keep that PR behavior-compatible. Related TODOs already exist in fastapi_gcp_tasks/scheduler.py and async_scheduler.py.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions