File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -150,12 +150,16 @@ def data(self):
150150 return self ._data
151151
152152 def check_limit_exceeded (self ):
153+ limit_exceeded , reason = False , ""
153154 if isinstance (self ._data , dict ) and (
154155 "response" in self ._data and "limit_exceeded" in self ._data ["response" ] and self ._data ["response" ]["limit_exceeded" ] is True
155156 ):
156- raise ServiceException ( 503 , f"Limit Exceeded: { self ._data ['response' ]['message' ]} " )
157+ limit_exceeded , reason = True , f"Limit Exceeded: { self ._data ['response' ]['message' ]} "
157158 elif "response" in self ._data and "limit_exceeded" in self ._data :
158- raise ServiceException (503 , "Limit Exceeded" )
159+ limit_exceeded , reason = True , "Limit Exceeded"
160+
161+ if limit_exceeded :
162+ raise ServiceException (503 , reason )
159163
160164 @property
161165 def status (self ):
You can’t perform that action at this time.
0 commit comments