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
Describe the bug
Using 2.3.7.6 for api/v1/site, querying for area via name = Global/EMEA/missing, the CCC UI gives 500 in the UI:
{
"message": ["The input site is not valid or site is not present."]
}
This is compatible with the code, however when I use the SDK for the same query I get:
{
"message": ["The input site is not valid or site is not present."],
"response":[]
}
This empty response list breaks the ApiError.__init__, because it assumes response is either absent or a dict.
I realize this may actually be a bug in DNA Center rather than the SDK, but I figured it might be good to cater for the case where it actually sends an empty list for robustness?
Expected behavior
I've come to expect the ApiError exceptions when data is simply not there - I think the v2 approach with 200 + empty response is more sane, but for v1 the SDK should still be able to raise an ApiError with the message at least.
I'll migrate to the v2 endpoint which doesn't have this issue, but this is causing production issues as we didn't notices this in our testing prior to upgrading to the current version, and the fix seems quite small.
I don't think you really encourage PRs? If you wan't I could do one.
Screenshots
Environment (please complete the following information):
Cisco DNA Center Version and patch: 2.3.7.6-70319
Python version: 3.11
SDK version: 2.7.3 + 2.7.7
OS Version: Ubuntu
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe the bug
Using 2.3.7.6 for api/v1/site, querying for area via name = Global/EMEA/missing, the CCC UI gives 500 in the UI:
This is compatible with the code, however when I use the SDK for the same query I get:
This empty
response
list breaks theApiError.__init__
, because it assumes response is either absent or a dict.I realize this may actually be a bug in DNA Center rather than the SDK, but I figured it might be good to cater for the case where it actually sends an empty list for robustness?
Expected behavior
I've come to expect the ApiError exceptions when data is simply not there - I think the v2 approach with 200 + empty response is more sane, but for v1 the SDK should still be able to raise an ApiError with the message at least.
I'll migrate to the v2 endpoint which doesn't have this issue, but this is causing production issues as we didn't notices this in our testing prior to upgrading to the current version, and the fix seems quite small.
I don't think you really encourage PRs? If you wan't I could do one.
Screenshots
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: