⚡ Solution Summary
- Import statements for error handling were incorrect
- Fix released in version 14.0.1
- Ensure to upgrade to the latest version.
### Describe the bug
API documentation suggests using `stripe.error.SomeError` but current modules are not importable as described.
[API Doc](https://docs.stripe.com/api/errors/handling?api-version=2025-11-17.preview&rds=1)
### To Reproduce
```shell
>>> import stripe.error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stripe.error'
>>> from stripe import error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'error' from 'stripe'
>>> import stripe.error.CardError
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stripe.error'
>>> import stripe
>>> stripe.error.CardError
Traceback (most recent call last):
File "/.../python3.12/site-packages/stripe/__init__.py", line 872, in __getattr__
target, is_submodule = _import_map[name]
~~~~~~~~~~~^^^^^^
KeyError: 'error'
```
### Expected behavior
```repl
>>> import stripe
>>> stripe.error.CardError
<class 'stripe._error.CardError'>
```
### Code snippets
```Python
```
### OS
macOS
### Language version
Python 3.12
### Library version
stripe-python v14.0.0
### API version
2025-11-17.clover
### Additional context
_No response_
Discussion & Fixes