diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 58402959..c45ef4f2 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -79,7 +79,10 @@ class MpdFrontend(object): matches = re.match(pattern, request) if matches is not None: return (_request_handlers[pattern], matches.groupdict()) - raise MpdUnknownCommand(command=request.split(' ')[0]) + command = request.split(' ')[0] + if command in _commands: + raise MpdArgError(u'incorrect arguments', command=command) + raise MpdUnknownCommand(command=command) def handle_response(self, result, add_ok=True): response = [] diff --git a/tests/mpd/frontend_test.py b/tests/mpd/frontend_test.py index 6cb77415..a03d1b17 100644 --- a/tests/mpd/frontend_test.py +++ b/tests/mpd/frontend_test.py @@ -993,8 +993,7 @@ class MusicDatabaseHandlerTest(unittest.TestCase): def test_list_artist_with_artist_should_fail(self): result = self.h.handle_request(u'list "artist" "anartist"') - self.assertEqual(result[0], - u'ACK [2@0] {list} should be "Album" for 3 arguments') + self.assertEqual(result[0], u'ACK [2@0] {list} incorrect arguments') def test_list_album_without_artist(self): result = self.h.handle_request(u'list "album"')