File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 55from questionpy_server .worker .runtime .messages import BaseWorkerError
66
77
8- class WorkerNotRunningError (BaseWorkerError ):
9- pass
8+ class WorkerStoppedError (BaseWorkerError ):
9+ """Represents an error that results in or was caused by a worker being stopped."""
1010
1111
1212class WorkerStartError (BaseWorkerError ):
1313 pass
1414
1515
16- class WorkerCPUTimeLimitExceededError (BaseWorkerError ):
16+ class WorkerNotRunningError (WorkerStoppedError ):
17+ pass
18+
19+
20+ class WorkerCPUTimeLimitExceededError (WorkerStoppedError ):
1721 def __init__ (self , limit : float , worker_name : str ):
1822 self .limit = limit
1923 super ().__init__ (
2024 f"Worker has exceeded its CPU time limit of { limit } seconds and was killed." , worker_name = worker_name
2125 )
2226
2327
24- class WorkerRealTimeLimitExceededError (BaseWorkerError ):
28+ class WorkerRealTimeLimitExceededError (WorkerStoppedError ):
2529 def __init__ (self , limit : float , worker_name : str ):
2630 self .limit = limit
2731 super ().__init__ (
Original file line number Diff line number Diff line change 2929 WorkerNotRunningError ,
3030 WorkerRealTimeLimitExceededError ,
3131 WorkerStartError ,
32+ WorkerStoppedError ,
3233)
3334from questionpy_server .worker .runtime .messages import (
3435 BaseWorkerError ,
@@ -141,7 +142,7 @@ async def send_and_wait_for_response(
141142 self .state = WorkerState .SERVER_AWAITS_RESPONSE
142143 try :
143144 result = await fut
144- except WorkerNotRunningError :
145+ except WorkerStoppedError :
145146 self .state = WorkerState .NOT_RUNNING
146147 raise
147148 finally :
You can’t perform that action at this time.
0 commit comments