Skip to content

Commit 3a17b82

Browse files
Remove response.raise_for_status() in methods as this is handled globally
1 parent d271b6b commit 3a17b82

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed
-466 Bytes
Binary file not shown.

authsignal/client.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ def track(self, user_id, action, payload=None, path=None):
124124
headers=headers,
125125
timeout=timeout,
126126
params=params)
127-
response.raise_for_status()
128127

129128
return response.json()
130129

@@ -151,7 +150,6 @@ def get_action(self, user_id, action, idempotency_key, path=None):
151150
headers=headers,
152151
timeout=timeout,
153152
params=params)
154-
response.raise_for_status()
155153

156154
return response.json()
157155

@@ -180,8 +178,7 @@ def get_user(self, user_id, redirect_url=None, path=None):
180178
headers=headers,
181179
timeout=timeout,
182180
params=params)
183-
response.raise_for_status()
184-
181+
185182
return response.json()
186183

187184
def delete_user(self, user_id):
@@ -196,7 +193,7 @@ def delete_user(self, user_id):
196193
headers=headers,
197194
timeout=self.timeout
198195
)
199-
response.raise_for_status()
196+
200197
return response.json()
201198

202199
def delete_authenticator(self, user_id: str, user_authenticator_id: str) -> Dict[str, Any]:
@@ -214,7 +211,7 @@ def delete_authenticator(self, user_id: str, user_authenticator_id: str) -> Dict
214211
headers=headers,
215212
timeout=self.timeout
216213
)
217-
response.raise_for_status()
214+
218215
return response.json()
219216

220217
def update_user(self, user_id, data):
@@ -230,8 +227,6 @@ def update_user(self, user_id, data):
230227
auth=requests.auth.HTTPBasicAuth(self.api_key, '')
231228
)
232229

233-
response.raise_for_status()
234-
235230
return response.json()
236231

237232
def enroll_verified_authenticator(self, user_id, authenticator_payload, path=None):
@@ -257,7 +252,7 @@ def enroll_verified_authenticator(self, user_id, authenticator_payload, path=No
257252
headers=headers,
258253
timeout=timeout,
259254
params=params)
260-
response.raise_for_status()
255+
261256
return response.json()
262257

263258
def validate_challenge(self, token: str, user_id: Optional[str] = None, action: Optional[str] = None) -> Dict[str, Any]:
@@ -275,9 +270,7 @@ def validate_challenge(self, token: str, user_id: Optional[str] = None, action:
275270
timeout=self.timeout
276271
)
277272

278-
response_data = response.json()
279-
280-
return response_data
273+
return response.json()
281274

282275
def _default_headers(self):
283276
return {'Content-type': 'application/json',

0 commit comments

Comments
 (0)