antosart / mopidy-cd

A plugin for mopidy for playing music from CD
Apache License 2.0
16 stars 12 forks source link

DiscError: cannot read table of contents #8

Closed lnkpaulo closed 7 years ago

lnkpaulo commented 7 years ago

Hi,

First of all thanks for this nice extension and for the last quick fix.

I know it is a beta version but there is a case where an important exception is not treated, it is when there isn't an audio cd. Please see the error:

ERROR [1629:Core-10] mopidy.core.library: CdBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/local/lib/python2.7/dist-packages/Mopidy_Cd-0.2-py2.7.egg/mopidy_cd/backend.py", line 26, in browse
    self.refresh()
  File "/usr/local/lib/python2.7/dist-packages/Mopidy_Cd-0.2-py2.7.egg/mopidy_cd/backend.py", line 38, in refresh
    self.backend.cdrom.refresh()
  File "/usr/local/lib/python2.7/dist-packages/Mopidy_Cd-0.2-py2.7.egg/mopidy_cd/cdrom.py", line 20, in refresh
    self.disc = discid.read()
  File "/usr/local/lib/python2.7/dist-packages/discid/disc.py", line 55, in read
    disc.read(device, features)
  File "/usr/local/lib/python2.7/dist-packages/discid/disc.py", line 152, in read
    raise DiscError(self._get_error_msg())
DiscError: cannot read table of contents

Despite of the error if an audio cd is inserted it works. In the future I can pull requests with fixes but until then I need to prepare a mopidy dev environment.

Thanks.