docs: Add {Backend,Frontend,Mixer}Error guidelines to backend/frontend/mixer APIs
This commit is contained in:
parent
95bddf666b
commit
83f1d00944
@ -29,12 +29,12 @@ The following requirements applies to any frontend implementation:
|
|||||||
- The main actor MUST be able to start and stop the frontend when the main
|
- The main actor MUST be able to start and stop the frontend when the main
|
||||||
actor is started and stopped.
|
actor is started and stopped.
|
||||||
|
|
||||||
- The frontend MAY require additional settings to be set for it to
|
- The frontend MAY require additional config values to be set for it to work.
|
||||||
work.
|
|
||||||
|
|
||||||
- Such settings MUST be documented.
|
- Such config values MUST be documented.
|
||||||
|
|
||||||
- The main actor MUST stop itself if the defined settings are not adequate for
|
- The main actor MUST raise the :exc:`~mopidy.exceptions.FrontendError` with a
|
||||||
|
descriptive error message if the defined config values are not adequate for
|
||||||
the frontend to work properly.
|
the frontend to work properly.
|
||||||
|
|
||||||
- Any actor which is part of the frontend MAY implement the
|
- Any actor which is part of the frontend MAY implement the
|
||||||
|
|||||||
@ -6,6 +6,14 @@ from mopidy import listener
|
|||||||
|
|
||||||
|
|
||||||
class Backend(object):
|
class Backend(object):
|
||||||
|
"""Backend API
|
||||||
|
|
||||||
|
If the backend has problems during initialization it should raise
|
||||||
|
:exc:`~mopidy.exceptions.BackendError` with a descriptive error message.
|
||||||
|
This will make Mopidy print the error message and exit so that the user can
|
||||||
|
fix the issue.
|
||||||
|
"""
|
||||||
|
|
||||||
#: Actor proxy to an instance of :class:`mopidy.audio.Audio`.
|
#: Actor proxy to an instance of :class:`mopidy.audio.Audio`.
|
||||||
#:
|
#:
|
||||||
#: Should be passed to the backend constructor as the kwarg ``audio``,
|
#: Should be passed to the backend constructor as the kwarg ``audio``,
|
||||||
|
|||||||
@ -2,7 +2,13 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
|
|
||||||
class Mixer(object):
|
class Mixer(object):
|
||||||
"""Audio mixer API"""
|
"""Audio mixer API
|
||||||
|
|
||||||
|
If the mixer has problems during initialization it should raise
|
||||||
|
:exc:`~mopidy.exceptions.MixerError` with a descriptive error message. This
|
||||||
|
will make Mopidy print the error message and exit so that the user can fix
|
||||||
|
the issue.
|
||||||
|
"""
|
||||||
|
|
||||||
name = None
|
name = None
|
||||||
"""Name of the mixer.
|
"""Name of the mixer.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user