pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
103 stars 30 forks source link

Possibility to catch CellularError - Enhancement #30

Closed sebi5361 closed 4 years ago

sebi5361 commented 4 years ago

Would it be possible to catch the CellularError in the futur? Currently:

>>> import cellular
>>> try:
...     cellular.gprs("not_a_real_apn", "", "")
... except CellularError as e:
...     print(e)
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'CellularError' isn't defined
>>>
pulkin commented 4 years ago

cellular.CellularError

sebi5361 commented 4 years ago

Thank you. I didn't know this syntax (but it makes sense).