Skip to content
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

exception handling for hexpansion I2C #190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Robotmad
Copy link
Contributor

Fix for Issue #188.

If hexpansion is unplugged during an I2C operation an OSError exception is generated which was not being trapped leading to a crash. i2c read and write operations now protected and abort the transfer, not attempting any further bytes.

@kliment
Copy link
Contributor

kliment commented Aug 21, 2024

Far as I can see, this can result in incomplete reads that then get interpreted as a filesystem. We should probably handle this error one level higher

@ChrisDick
Copy link
Contributor

I've given this a try and it does lead to incomplete file reads that are then run.

Traceback (most recent call last):
File "main.py", line 43, in
File "system/scheduler/init.py", line 243, in run_forever
File "asyncio/core.py", line 1, in run_until_complete
File "asyncio/core.py", line 1, in run_until_complete
File "asyncio/core.py", line 1, in run_until_complete
File "system/scheduler/init.py", line 239, in _main
File "asyncio/funcs.py", line 1, in gather
File "asyncio/core.py", line 1, in run_until_complete
File "system/eventbus.py", line 101, in run
File "asyncio/funcs.py", line 1, in gather
File "asyncio/core.py", line 1, in run_until_complete
File "system/hexpansion/app.py", line 254, in handle_hexpansion_insertion
File "system/hexpansion/app.py", line 216, in _mount_eeprom
File "system/hexpansion/app.py", line 142, in _launch_hexpansion_app
File "hexpansion_2/app.py", line 62
IndentationError: unindent doesn't match any outer indent level

there is no indentation problem with the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants