forked from locustio/locust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exception.py
87 lines (56 loc) · 1.9 KB
/
exception.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class LocustError(Exception):
pass
class ResponseError(Exception):
pass
class CatchResponseError(Exception):
pass
class MissingWaitTimeError(LocustError):
pass
class InterruptTaskSet(Exception):
"""
Exception that will interrupt a User when thrown inside a task
"""
def __init__(self, reschedule=True):
"""
If *reschedule* is True and the InterruptTaskSet is raised inside a nested TaskSet,
the parent TaskSet would immediately reschedule another task.
"""
self.reschedule = reschedule
class StopUser(Exception):
pass
class RescheduleTask(Exception):
"""
When raised in a task it's equivalent of a return statement.
Also used internally by TaskSet. When raised within the task control flow of a TaskSet,
but not inside a task, the execution should be handed over to the parent TaskSet.
"""
class RescheduleTaskImmediately(Exception):
"""
When raised in a User task, another User task will be rescheduled immediately (without calling wait_time first)
"""
class RPCError(Exception):
"""
Exception that shows bad or broken network.
When raised from zmqrpc, RPC should be reestablished.
"""
class RPCSendError(Exception):
"""
Exception when sending message to client.
When raised from zmqrpc, sending can be retried or RPC can be reestablished.
"""
class RPCReceiveError(Exception):
"""
Exception when receiving message from client is interrupted or message is corrupted.
When raised from zmqrpc, client connection should be reestablished.
"""
def __init__(self, *args: object, addr=None) -> None:
super().__init__(*args)
self.addr = addr
class AuthCredentialsError(ValueError):
"""
Exception when the auth credentials provided
are not in the correct format
"""
pass
class RunnerAlreadyExistsError(Exception):
pass