Coverage for dataexcept/exceptions/lifecycle.py: 82%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-09-03 20:46 +0000

1from .base import JobError 

2 

3 

4class JobCancellationError(JobError): 

5 """Raised when a job is cancelled before completion.""" 

6 

7 def __init__(self, job_id: str, reason: str | None = None): 

8 self.job_id = job_id 

9 self.reason = reason 

10 msg = f"Job '{job_id}' was cancelled" 

11 if reason: 11 ↛ 12line 11 didn't jump to line 12 because the condition on line 11 was never true

12 msg += f": {reason}" 

13 super().__init__(msg)