-
Notifications
You must be signed in to change notification settings - Fork 18
Clearer error raised when function gives improper HTTP response return #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Explicitly check for list/tuple of length 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think?
Co-authored-by: Dan Halbert <[email protected]>
@dhalbert great suggestion, I always forget that multiple exception can be caught. I think that perfectly does what I was trying to do in a more Pythonic way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Ha!
|
Haha you caught me as I was fixing it, should be all set now, also uses the |
Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 to 3.1.0 from 3.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_APDS9960#42 from bablokb/4upstream > Fixed readthedocs build > Post-patch cleanup Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.4.1 from 4.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#52 from jerryneedell/jerryn_mlc Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.5.6 from 1.5.5: > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#30 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.6.0 from 3.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#35 from whogben/main > Fixed readthedocs build > Consolidate Documentation sections of README Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.12.3 from 1.12.2: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#54 from masgari/main Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.2.2 from 8.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#159 from dhalbert/nus-doc-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC to 1.0.6 from 1.0.5: > Fixed readthedocs build Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 2.1.8 from 2.1.7: > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#82 from makermelissa/main > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#81 from makermelissa/main > Fixed readthedocs build Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.3.0 from 5.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#106 from dgriswo/subscription_logging Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.11.1 from 1.11.0: > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#64 from makermelissa/main Updating https://github.com/adafruit/Adafruit_CircuitPython_WSGI to 1.1.9 from 1.1.8: > Merge pull request adafruit/Adafruit_CircuitPython_WSGI#13 from tekktrik/dev/clearer-bad-return > Fixed readthedocs build > Post-patch cleanup
Resolves #11 by transforming
TypeError
intoRuntimeError
that also references that faulty method/function in question. I do this all the time (-_-"). It will explicitly check for a list or tuple of length 3, which is the expected response for a request handler.Tested on
Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Pybadge with samd51j19
with AirLift FeatherWing