prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  During handling of the above exception, another exception occurred
  In the examples/exception_monitoring.py, when i try to run the app and hit the default route, it prints out the exception and then it calls "return super.default(self, request, exception)", it returns with the following exception:
  
  AttributeError: type object 'super' has no attribute 'default'
  
  looks like in the exceptions.py, this line is the culprit (i could be wrong):
  
  `handler = self.handlers.get(type(exception), self.default)
  `
   since __init__ does not have that attribute defined.  I am running python 3.6
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/exception_monitoring.py`
  Content:
  ```
  1 """
  2 Example intercepting uncaught exceptions using Sanic's error handler framework.
  3 
  4 This may be useful for developers wishing to use Sentry, Airbrake, etc.
  5 or a custom system to log and monitor unexpected errors in production.
  6 
  7 First we create our own class inheriting from Handler in sanic.exceptions,
  8 and pass in an instance of it when we create our Sanic instance. Inside this
  9 class' default handler, we can do anything including sending exceptions to
  10 an external service.
  11 """
  12 
  13 
  14 
  15 """
  16 Imports and code relevant for our CustomHandler class
  17 (Ordinarily this would be in a separate file)
  18 """
  19 from sanic.response import text
  20 from sanic.exceptions import Handler, SanicException
  21 
  22 class CustomHandler(Handler):
  23     def default(self, request, exception):
  24         # Here, we have access to the exception object
  25         # and can do anything with it (log, send to external service, etc)
  26 
  27         # Some exceptions are trivial and built into Sanic (404s, etc)
  28         if not issubclass(type(exception), SanicException):
  29             print(exception)
  30 
  31         # Then, we must finish handling the exception by returning
  32         # our response to the client
  33         # For this we can just call the super class' default handler
  34         return super.default(self, request, exception)
  35 
  36 
  37 
  38 
  39 """
  40 This is an ordinary Sanic server, with the exception that we set the
  41 server's error_handler to an instance of our CustomHandler
  42 """
  43 
  44 from sanic import Sanic
  45 from sanic.response import json
  46 
  47 app = Sanic(__name__)
  48 
  49 handler = CustomHandler(sanic=app)
  50 app.error_handler = handler
  51 
  52 @app.route("/")
  53 async def test(request):
  54     # Here, something occurs which causes an unexpected exception
  55     # This exception will flow to our custom handler.
  56     x = 1 / 0
  57     return json({"test": True})
  58 
  59 
  60 app.run(host="0.0.0.0", port=8000, debug=True)
  61
  ```
  --- 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/examples/exception_monitoring.py b/examples/exception_monitoring.py
  --- a/examples/exception_monitoring.py
  +++ b/examples/exception_monitoring.py
  @@ -9,17 +9,15 @@
   class' default handler, we can do anything including sending exceptions to
   an external service.
   """
  -
  -
  -
  +from sanic.exceptions import Handler, SanicException
   """
   Imports and code relevant for our CustomHandler class
   (Ordinarily this would be in a separate file)
   """
  -from sanic.response import text
  -from sanic.exceptions import Handler, SanicException
  +
   
   class CustomHandler(Handler):
  +
       def default(self, request, exception):
           # Here, we have access to the exception object
           # and can do anything with it (log, send to external service, etc)
  @@ -31,9 +29,7 @@
           # Then, we must finish handling the exception by returning
           # our response to the client
           # For this we can just call the super class' default handler
  -        return super.default(self, request, exception)
  -
  -
  +        return super().default(request, exception)
   
   
   """
  @@ -49,11 +45,12 @@
   handler = CustomHandler(sanic=app)
   app.error_handler = handler
   
  +
   @app.route("/")
   async def test(request):
       # Here, something occurs which causes an unexpected exception
       # This exception will flow to our custom handler.
  -    x = 1 / 0
  +    1 / 0
       return json({"test": True})
  
verification_info: {"golden_diff": "diff --git a/examples/exception_monitoring.py b/examples/exception_monitoring.py\n--- a/examples/exception_monitoring.py\n+++ b/examples/exception_monitoring.py\n@@ -9,17 +9,15 @@\n class' default handler, we can do anything including sending exceptions to\n an external service.\n \"\"\"\n-\n-\n-\n+from sanic.exceptions import Handler, SanicException\n \"\"\"\n Imports and code relevant for our CustomHandler class\n (Ordinarily this would be in a separate file)\n \"\"\"\n-from sanic.response import text\n-from sanic.exceptions import Handler, SanicException\n+\n \n class CustomHandler(Handler):\n+\n     def default(self, request, exception):\n         # Here, we have access to the exception object\n         # and can do anything with it (log, send to external service, etc)\n@@ -31,9 +29,7 @@\n         # Then, we must finish handling the exception by returning\n         # our response to the client\n         # For this we can just call the super class' default handler\n-        return super.default(self, request, exception)\n-\n-\n+        return super().default(request, exception)\n \n \n \"\"\"\n@@ -49,11 +45,12 @@\n handler = CustomHandler(sanic=app)\n app.error_handler = handler\n \n+\n @app.route(\"/\")\n async def test(request):\n     # Here, something occurs which causes an unexpected exception\n     # This exception will flow to our custom handler.\n-    x = 1 / 0\n+    1 / 0\n     return json({\"test\": True})\n", "issue": "During handling of the above exception, another exception occurred\nIn the examples/exception_monitoring.py, when i try to run the app and hit the default route, it prints out the exception and then it calls \"return super.default(self, request, exception)\", it returns with the following exception:\r\n\r\nAttributeError: type object 'super' has no attribute 'default'\r\n\r\nlooks like in the exceptions.py, this line is the culprit (i could be wrong):\r\n\r\n`handler = self.handlers.get(type(exception), self.default)\r\n`\r\n since __init__ does not have that attribute defined.  I am running python 3.6\n", "before_files": [{"content": "\"\"\"\nExample intercepting uncaught exceptions using Sanic's error handler framework.\n\nThis may be useful for developers wishing to use Sentry, Airbrake, etc.\nor a custom system to log and monitor unexpected errors in production.\n\nFirst we create our own class inheriting from Handler in sanic.exceptions,\nand pass in an instance of it when we create our Sanic instance. Inside this\nclass' default handler, we can do anything including sending exceptions to\nan external service.\n\"\"\"\n\n\n\n\"\"\"\nImports and code relevant for our CustomHandler class\n(Ordinarily this would be in a separate file)\n\"\"\"\nfrom sanic.response import text\nfrom sanic.exceptions import Handler, SanicException\n\nclass CustomHandler(Handler):\n    def default(self, request, exception):\n        # Here, we have access to the exception object\n        # and can do anything with it (log, send to external service, etc)\n\n        # Some exceptions are trivial and built into Sanic (404s, etc)\n        if not issubclass(type(exception), SanicException):\n            print(exception)\n\n        # Then, we must finish handling the exception by returning\n        # our response to the client\n        # For this we can just call the super class' default handler\n        return super.default(self, request, exception)\n\n\n\n\n\"\"\"\nThis is an ordinary Sanic server, with the exception that we set the\nserver's error_handler to an instance of our CustomHandler\n\"\"\"\n\nfrom sanic import Sanic\nfrom sanic.response import json\n\napp = Sanic(__name__)\n\nhandler = CustomHandler(sanic=app)\napp.error_handler = handler\n\n@app.route(\"/\")\nasync def test(request):\n    # Here, something occurs which causes an unexpected exception\n    # This exception will flow to our custom handler.\n    x = 1 / 0\n    return json({\"test\": True})\n\n\napp.run(host=\"0.0.0.0\", port=8000, debug=True)\n", "path": "examples/exception_monitoring.py"}], "after_files": [{"content": "\"\"\"\nExample intercepting uncaught exceptions using Sanic's error handler framework.\n\nThis may be useful for developers wishing to use Sentry, Airbrake, etc.\nor a custom system to log and monitor unexpected errors in production.\n\nFirst we create our own class inheriting from Handler in sanic.exceptions,\nand pass in an instance of it when we create our Sanic instance. Inside this\nclass' default handler, we can do anything including sending exceptions to\nan external service.\n\"\"\"\nfrom sanic.exceptions import Handler, SanicException\n\"\"\"\nImports and code relevant for our CustomHandler class\n(Ordinarily this would be in a separate file)\n\"\"\"\n\n\nclass CustomHandler(Handler):\n\n    def default(self, request, exception):\n        # Here, we have access to the exception object\n        # and can do anything with it (log, send to external service, etc)\n\n        # Some exceptions are trivial and built into Sanic (404s, etc)\n        if not issubclass(type(exception), SanicException):\n            print(exception)\n\n        # Then, we must finish handling the exception by returning\n        # our response to the client\n        # For this we can just call the super class' default handler\n        return super().default(request, exception)\n\n\n\"\"\"\nThis is an ordinary Sanic server, with the exception that we set the\nserver's error_handler to an instance of our CustomHandler\n\"\"\"\n\nfrom sanic import Sanic\nfrom sanic.response import json\n\napp = Sanic(__name__)\n\nhandler = CustomHandler(sanic=app)\napp.error_handler = handler\n\n\n@app.route(\"/\")\nasync def test(request):\n    # Here, something occurs which causes an unexpected exception\n    # This exception will flow to our custom handler.\n    1 / 0\n    return json({\"test\": True})\n\n\napp.run(host=\"0.0.0.0\", port=8000, debug=True)\n", "path": "examples/exception_monitoring.py"}]}