Checklist
Description
I believe this is loosely similar to #793 . In this case, it seems ApiError is not properly referenced because core is not properly referenced:
core/init.py actually has ApiError in both the TYPE_CHECKING block and
all. So from auth0.management.core import ApiError should be resolvable by PyCharm. The
problem is one level up — PyCharm can't resolve auth0.management.core as a subpackage because
auth0.management.init.py doesn't reference core.
This happens to make the README somewhat troubling...
|
## Exception Handling |
|
|
|
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error |
|
will be thrown. |
|
|
|
```python |
|
from auth0.management.core.api_error import ApiError |
|
|
|
try: |
|
client.actions.create(...) |
|
except ApiError as e: |
|
print(e.status_code) |
|
print(e.body) |
|
``` |
... in that using the following code produces what seems like an error:
Reproduction
# noinspection PyProtectedMember
from auth0.management import ManagementClient # type: ignore[attr-defined] # https://github.com/auth0/auth0-python/pull/785#issuecomment-4137213608
from auth0.management.core.api_error import ApiError # <---- you will see the intellisense error here
client = ManagementClient(
domain="YOUR_TENANT.auth0.com",
token="YOUR_TOKEN",
)
try:
client.actions.create(...)
except ApiError as e:
print(e.status_code)
print(e.body)
Additional context
No response
auth0-python version
5.1.0
Python version
Python 3.13.12
Checklist
Description
I believe this is loosely similar to #793 . In this case, it seems
ApiErroris not properly referenced becausecoreis not properly referenced:This happens to make the README somewhat troubling...
auth0-python/README.md
Lines 182 to 195 in e506d73
... in that using the following code produces what seems like an error:
Reproduction
Additional context
No response
auth0-python version
5.1.0
Python version
Python 3.13.12