Skip to content

Commit 6c29a3f

Browse files
committed
Add new exception classes
1 parent c0fcfb2 commit 6c29a3f

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

‎stream/exceptions.py‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,77 @@ class SiteSuspendedException(StreamApiException):
7070
status_code = 401
7171
code = 7
7272

73+
class InvalidPaginationException(StreamApiException):
74+
75+
'''
76+
Raised when there is an issue with your Access Key
77+
'''
78+
status_code = 401
79+
code = 8
80+
81+
82+
class MissingRankingException(FeedConfigException):
83+
'''
84+
Raised when you didn't configure the ranking for the given feed
85+
'''
86+
status_code = 400
87+
code = 12
88+
89+
90+
class MissingUserException(MissingRankingException):
91+
status_code = 400
92+
code = 10
93+
94+
95+
class RankingException(FeedConfigException):
96+
'''
97+
Raised when there is a runtime issue with ranking the feed
98+
'''
99+
status_code = 400
100+
code = 11
101+
102+
103+
class RateLimitReached(StreamApiException):
104+
105+
'''
106+
Raised when too many requests are performed
107+
'''
108+
status_code = 429
109+
code = 9
110+
111+
112+
class OldStorageBackend(StreamApiException):
113+
'''
114+
Raised if you try to perform an action which only works with the new storage
115+
'''
116+
status_code = 400
117+
code = 13
118+
119+
120+
class BestPracticeException(StreamApiException):
121+
'''
122+
Raised if best practices are enforced and you do something that
123+
would break a high volume integration
124+
'''
125+
status_code = 400
126+
code = 15
127+
128+
129+
class DoesNotExistException(StreamApiException):
130+
'''
131+
Raised when the requested resource could not be found.
132+
'''
133+
status_code = 404
134+
code = 16
135+
136+
137+
class NotAllowedException(StreamApiException):
138+
'''
139+
Raised when the requested action is not allowed for some reason.
140+
'''
141+
status_code = 403
142+
code = 17
143+
73144

74145
def get_exceptions():
75146
from stream import exceptions

0 commit comments

Comments
 (0)