prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add a BUSYGROUP reply error
  The XGROUP CREATE command can return a BUSYGROUP error when a group already exists: https://redis.io/commands/xgroup
  
  I think the `ReplyError` subclass for matching it would look like this:
  
  ```py
  class BusyGroupError(ReplyError):
      MATCH_REPLY = "BUSYGROUP Consumer Group name already exists"
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `aioredis/errors.py`
  Content:
  ```
  1 __all__ = [
  2     'RedisError',
  3     'ProtocolError',
  4     'ReplyError',
  5     'MaxClientsError',
  6     'AuthError',
  7     'PipelineError',
  8     'MultiExecError',
  9     'WatchVariableError',
  10     'ChannelClosedError',
  11     'ConnectionClosedError',
  12     'ConnectionForcedCloseError',
  13     'PoolClosedError',
  14     'MasterNotFoundError',
  15     'SlaveNotFoundError',
  16     'ReadOnlyError',
  17     ]
  18 
  19 
  20 class RedisError(Exception):
  21     """Base exception class for aioredis exceptions."""
  22 
  23 
  24 class ProtocolError(RedisError):
  25     """Raised when protocol error occurs."""
  26 
  27 
  28 class ReplyError(RedisError):
  29     """Raised for redis error replies (-ERR)."""
  30 
  31     MATCH_REPLY = None
  32 
  33     def __new__(cls, msg, *args):
  34         for klass in cls.__subclasses__():
  35             if msg and klass.MATCH_REPLY and msg.startswith(klass.MATCH_REPLY):
  36                 return klass(msg, *args)
  37         return super().__new__(cls, msg, *args)
  38 
  39 
  40 class MaxClientsError(ReplyError):
  41     """Raised for redis server when the maximum number of client has been
  42     reached."""
  43 
  44     MATCH_REPLY = "ERR max number of clients reached"
  45 
  46 
  47 class AuthError(ReplyError):
  48     """Raised when authentication errors occurs."""
  49 
  50     MATCH_REPLY = ("NOAUTH ", "ERR invalid password")
  51 
  52 
  53 class PipelineError(RedisError):
  54     """Raised if command within pipeline raised error."""
  55 
  56     def __init__(self, errors):
  57         super().__init__('{} errors:'.format(self.__class__.__name__), errors)
  58 
  59 
  60 class MultiExecError(PipelineError):
  61     """Raised if command within MULTI/EXEC block caused error."""
  62 
  63 
  64 class WatchVariableError(MultiExecError):
  65     """Raised if watched variable changed (EXEC returns None)."""
  66 
  67 
  68 class ChannelClosedError(RedisError):
  69     """Raised when Pub/Sub channel is unsubscribed and messages queue is empty.
  70     """
  71 
  72 
  73 class ReadOnlyError(RedisError):
  74     """Raised from slave when read-only mode is enabled"""
  75 
  76 
  77 class MasterNotFoundError(RedisError):
  78     """Raised for sentinel master not found error."""
  79 
  80 
  81 class SlaveNotFoundError(RedisError):
  82     """Raised for sentinel slave not found error."""
  83 
  84 
  85 class MasterReplyError(RedisError):
  86     """Raised by sentinel client for master error replies."""
  87 
  88 
  89 class SlaveReplyError(RedisError):
  90     """Raised by sentinel client for slave error replies."""
  91 
  92 
  93 class ConnectionClosedError(RedisError):
  94     """Raised if connection to server was closed."""
  95 
  96 
  97 class ConnectionForcedCloseError(ConnectionClosedError):
  98     """Raised if connection was closed with .close() method."""
  99 
  100 
  101 class PoolClosedError(RedisError):
  102     """Raised if pool is closed."""
  103
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/aioredis/errors.py b/aioredis/errors.py
  --- a/aioredis/errors.py
  +++ b/aioredis/errors.py
  @@ -50,6 +50,12 @@
       MATCH_REPLY = ("NOAUTH ", "ERR invalid password")
   
   
  +class BusyGroupError(ReplyError):
  +    """Raised if Consumer Group name already exists."""
  +
  +    MATCH_REPLY = "BUSYGROUP Consumer Group name already exists"
  +
  +
   class PipelineError(RedisError):
       """Raised if command within pipeline raised error."""
  
verification_info: {"golden_diff": "diff --git a/aioredis/errors.py b/aioredis/errors.py\n--- a/aioredis/errors.py\n+++ b/aioredis/errors.py\n@@ -50,6 +50,12 @@\n     MATCH_REPLY = (\"NOAUTH \", \"ERR invalid password\")\n \n \n+class BusyGroupError(ReplyError):\n+    \"\"\"Raised if Consumer Group name already exists.\"\"\"\n+\n+    MATCH_REPLY = \"BUSYGROUP Consumer Group name already exists\"\n+\n+\n class PipelineError(RedisError):\n     \"\"\"Raised if command within pipeline raised error.\"\"\"\n", "issue": "Add a BUSYGROUP reply error\nThe XGROUP CREATE command can return a BUSYGROUP error when a group already exists: https://redis.io/commands/xgroup\r\n\r\nI think the `ReplyError` subclass for matching it would look like this:\r\n\r\n```py\r\nclass BusyGroupError(ReplyError):\r\n    MATCH_REPLY = \"BUSYGROUP Consumer Group name already exists\"\r\n```\n", "before_files": [{"content": "__all__ = [\n    'RedisError',\n    'ProtocolError',\n    'ReplyError',\n    'MaxClientsError',\n    'AuthError',\n    'PipelineError',\n    'MultiExecError',\n    'WatchVariableError',\n    'ChannelClosedError',\n    'ConnectionClosedError',\n    'ConnectionForcedCloseError',\n    'PoolClosedError',\n    'MasterNotFoundError',\n    'SlaveNotFoundError',\n    'ReadOnlyError',\n    ]\n\n\nclass RedisError(Exception):\n    \"\"\"Base exception class for aioredis exceptions.\"\"\"\n\n\nclass ProtocolError(RedisError):\n    \"\"\"Raised when protocol error occurs.\"\"\"\n\n\nclass ReplyError(RedisError):\n    \"\"\"Raised for redis error replies (-ERR).\"\"\"\n\n    MATCH_REPLY = None\n\n    def __new__(cls, msg, *args):\n        for klass in cls.__subclasses__():\n            if msg and klass.MATCH_REPLY and msg.startswith(klass.MATCH_REPLY):\n                return klass(msg, *args)\n        return super().__new__(cls, msg, *args)\n\n\nclass MaxClientsError(ReplyError):\n    \"\"\"Raised for redis server when the maximum number of client has been\n    reached.\"\"\"\n\n    MATCH_REPLY = \"ERR max number of clients reached\"\n\n\nclass AuthError(ReplyError):\n    \"\"\"Raised when authentication errors occurs.\"\"\"\n\n    MATCH_REPLY = (\"NOAUTH \", \"ERR invalid password\")\n\n\nclass PipelineError(RedisError):\n    \"\"\"Raised if command within pipeline raised error.\"\"\"\n\n    def __init__(self, errors):\n        super().__init__('{} errors:'.format(self.__class__.__name__), errors)\n\n\nclass MultiExecError(PipelineError):\n    \"\"\"Raised if command within MULTI/EXEC block caused error.\"\"\"\n\n\nclass WatchVariableError(MultiExecError):\n    \"\"\"Raised if watched variable changed (EXEC returns None).\"\"\"\n\n\nclass ChannelClosedError(RedisError):\n    \"\"\"Raised when Pub/Sub channel is unsubscribed and messages queue is empty.\n    \"\"\"\n\n\nclass ReadOnlyError(RedisError):\n    \"\"\"Raised from slave when read-only mode is enabled\"\"\"\n\n\nclass MasterNotFoundError(RedisError):\n    \"\"\"Raised for sentinel master not found error.\"\"\"\n\n\nclass SlaveNotFoundError(RedisError):\n    \"\"\"Raised for sentinel slave not found error.\"\"\"\n\n\nclass MasterReplyError(RedisError):\n    \"\"\"Raised by sentinel client for master error replies.\"\"\"\n\n\nclass SlaveReplyError(RedisError):\n    \"\"\"Raised by sentinel client for slave error replies.\"\"\"\n\n\nclass ConnectionClosedError(RedisError):\n    \"\"\"Raised if connection to server was closed.\"\"\"\n\n\nclass ConnectionForcedCloseError(ConnectionClosedError):\n    \"\"\"Raised if connection was closed with .close() method.\"\"\"\n\n\nclass PoolClosedError(RedisError):\n    \"\"\"Raised if pool is closed.\"\"\"\n", "path": "aioredis/errors.py"}], "after_files": [{"content": "__all__ = [\n    'RedisError',\n    'ProtocolError',\n    'ReplyError',\n    'MaxClientsError',\n    'AuthError',\n    'PipelineError',\n    'MultiExecError',\n    'WatchVariableError',\n    'ChannelClosedError',\n    'ConnectionClosedError',\n    'ConnectionForcedCloseError',\n    'PoolClosedError',\n    'MasterNotFoundError',\n    'SlaveNotFoundError',\n    'ReadOnlyError',\n    ]\n\n\nclass RedisError(Exception):\n    \"\"\"Base exception class for aioredis exceptions.\"\"\"\n\n\nclass ProtocolError(RedisError):\n    \"\"\"Raised when protocol error occurs.\"\"\"\n\n\nclass ReplyError(RedisError):\n    \"\"\"Raised for redis error replies (-ERR).\"\"\"\n\n    MATCH_REPLY = None\n\n    def __new__(cls, msg, *args):\n        for klass in cls.__subclasses__():\n            if msg and klass.MATCH_REPLY and msg.startswith(klass.MATCH_REPLY):\n                return klass(msg, *args)\n        return super().__new__(cls, msg, *args)\n\n\nclass MaxClientsError(ReplyError):\n    \"\"\"Raised for redis server when the maximum number of client has been\n    reached.\"\"\"\n\n    MATCH_REPLY = \"ERR max number of clients reached\"\n\n\nclass AuthError(ReplyError):\n    \"\"\"Raised when authentication errors occurs.\"\"\"\n\n    MATCH_REPLY = (\"NOAUTH \", \"ERR invalid password\")\n\n\nclass BusyGroupError(ReplyError):\n    \"\"\"Raised if Consumer Group name already exists.\"\"\"\n\n    MATCH_REPLY = \"BUSYGROUP Consumer Group name already exists\"\n\n\nclass PipelineError(RedisError):\n    \"\"\"Raised if command within pipeline raised error.\"\"\"\n\n    def __init__(self, errors):\n        super().__init__('{} errors:'.format(self.__class__.__name__), errors)\n\n\nclass MultiExecError(PipelineError):\n    \"\"\"Raised if command within MULTI/EXEC block caused error.\"\"\"\n\n\nclass WatchVariableError(MultiExecError):\n    \"\"\"Raised if watched variable changed (EXEC returns None).\"\"\"\n\n\nclass ChannelClosedError(RedisError):\n    \"\"\"Raised when Pub/Sub channel is unsubscribed and messages queue is empty.\n    \"\"\"\n\n\nclass ReadOnlyError(RedisError):\n    \"\"\"Raised from slave when read-only mode is enabled\"\"\"\n\n\nclass MasterNotFoundError(RedisError):\n    \"\"\"Raised for sentinel master not found error.\"\"\"\n\n\nclass SlaveNotFoundError(RedisError):\n    \"\"\"Raised for sentinel slave not found error.\"\"\"\n\n\nclass MasterReplyError(RedisError):\n    \"\"\"Raised by sentinel client for master error replies.\"\"\"\n\n\nclass SlaveReplyError(RedisError):\n    \"\"\"Raised by sentinel client for slave error replies.\"\"\"\n\n\nclass ConnectionClosedError(RedisError):\n    \"\"\"Raised if connection to server was closed.\"\"\"\n\n\nclass ConnectionForcedCloseError(ConnectionClosedError):\n    \"\"\"Raised if connection was closed with .close() method.\"\"\"\n\n\nclass PoolClosedError(RedisError):\n    \"\"\"Raised if pool is closed.\"\"\"\n", "path": "aioredis/errors.py"}]}