Skip to content

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