Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ except apideck.ApiException as e:
print("Exception when calling CrmApi->contacts_all: %s\n" % e)

# New SDK
from apideck_unify.errors import ApiError, ValidationError
from apideck_unify import Apideck, models

try:
result = client.crm.contacts.list()
except ValidationError as e:
print("Validation error:", e.message)
except ApiError as e:
print("API error:", e.message, e.status_code)
except models.BadRequestResponse as e:
# handle e.data: models.BadRequestResponseData
raise(e)
except models.UnauthorizedResponse as e:
# handle e.data: models.UnauthorizedResponseData
raise(e)
except models.ApiError as e:
raise(e)
```

For more information about error handling, please check our [documentation](https://github.com/apideck-libraries/sdk-python?tab=readme-ov-file#error-handling)
Expand Down