You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,14 +114,18 @@ except apideck.ApiException as e:
114
114
print("Exception when calling CrmApi->contacts_all: %s\n" % e)
115
115
116
116
# New SDK
117
-
from apideck_unify.errors import ApiError, ValidationError
117
+
from apideck_unify import Apideck, models
118
118
119
119
try:
120
120
result = client.crm.contacts.list()
121
-
except ValidationError as e:
122
-
print("Validation error:", e.message)
123
-
except ApiError as e:
124
-
print("API error:", e.message, e.status_code)
121
+
except models.BadRequestResponse as e:
122
+
# handle e.data: models.BadRequestResponseData
123
+
raise(e)
124
+
except models.UnauthorizedResponse as e:
125
+
# handle e.data: models.UnauthorizedResponseData
126
+
raise(e)
127
+
except models.ApiError as e:
128
+
raise(e)
125
129
```
126
130
127
131
For more information about error handling, please check our [documentation](https://github.com/apideck-libraries/sdk-python?tab=readme-ov-file#error-handling)
0 commit comments