Skip to content

Commit aed03d7

Browse files
authored
Update to exception handling (#157)
* Update to exception handling * update * Update
1 parent 45519d9 commit aed03d7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cradl"
3-
version = "0.4.3"
3+
version = "0.4.4"
44
description = "Python SDK for Cradl"
55
authors = [{ name = "Cradl", email = "[email protected]" }]
66
readme = "README.md"

src/cradl/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ def dictstrip(d):
3535
return {k: v for k, v in d.items() if v is not None}
3636

3737

38-
def _fatal_code(e):
39-
return 400 <= e.response.status_code < 500
38+
def _fatal_code(e: RequestException):
39+
if hasattr(e, 'response') and isinstance(e.response.status_code, int):
40+
return 400 <= e.response.status_code < 500
41+
raise e
4042

4143

4244
class Client:

0 commit comments

Comments
 (0)