From a1848aece50be42df55019914d3b9db61e11573f Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 9 Jul 2014 23:20:48 +0200 Subject: [PATCH] docs: Add {Backend,Frontend,Mixer}Error guidelines to backend/frontend/mixer APIs (cherry picked from commit 83f1d00944eaa2d22bffd9fc35ee3a9d990dfe41) Conflicts: mopidy/mixer.py --- docs/api/frontends.rst | 8 ++++---- mopidy/backend/__init__.py | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/api/frontends.rst b/docs/api/frontends.rst index 5e2f8d6c..b843692d 100644 --- a/docs/api/frontends.rst +++ b/docs/api/frontends.rst @@ -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 actor is started and stopped. -- The frontend MAY require additional settings to be set for it to - work. +- The frontend MAY require additional config values to be set for it to 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. - Any actor which is part of the frontend MAY implement the diff --git a/mopidy/backend/__init__.py b/mopidy/backend/__init__.py index 6f895985..68aad778 100644 --- a/mopidy/backend/__init__.py +++ b/mopidy/backend/__init__.py @@ -6,6 +6,14 @@ from mopidy import listener 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`. #: #: Should be passed to the backend constructor as the kwarg ``audio``,