Skip to content

Make program resistent to errors! #16

@rec

Description

@rec

This is a big one - it means catching exceptions and then doing something intelligent, perhaps even autoplaying all the way through if needs be.

Try these:

  • pull out DMX USB
  • pull out DMX cable
  • pull out MIDI USB
  • pull out MIDI for
  • expected scene changes don't come

NOTES:

  1. Sleeping the machine causes this exception.
  File "/Users/tom/synthetic/code/litoid/litoid/io/dmx.py", line 24, in render
    self.connection.render()
  File "/Users/tom/synthetic/code/litoid/.direnv/python-3.11.1/lib/python3.11/site-packages/pyenttec/__init__.py", line 196, in render
    self.com.write(self._packet_start + self.dmx_frame.tobytes() + _PACKET_END)
  File "/Users/tom/synthetic/code/litoid/.direnv/python-3.11.1/lib/python3.11/site-packages/serial/serialposix.py", line 655, in write
    raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: [Errno 6] Device not configured
  1. The DMX USB was unplugged and I got this at startup:
litoid/state/lamp.py:22: in make
    frame = dmx.frame[self.offset:self.offset + self.size]
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/functools.py:1001: in __get__
    val = self.func(instance)
litoid/io/dmx.py:17: in frame
    return memoryview(self.connection.dmx_frame)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/functools.py:1001: in __get__
    val = self.func(instance)
litoid/io/dmx.py:13: in connection
    return pyenttec.DMXConnection(self.port)
.direnv/python-3.11.1/lib/python3.11/site-packages/pyenttec/__init__.py:145: in __init__
    self._open_port()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions