diff --git a/sanic/blueprints.py b/sanic/blueprints.py index 6758ea95..5945c3ae 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -373,8 +373,8 @@ class Blueprint: :param uri: URL to be tagged to **GET** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -402,8 +402,8 @@ class Blueprint: :param uri: URL to be tagged to **POST** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -432,8 +432,8 @@ class Blueprint: :param uri: URL to be tagged to **PUT** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -456,8 +456,8 @@ class Blueprint: :param uri: URL to be tagged to **HEAD** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -479,8 +479,8 @@ class Blueprint: :param uri: URL to be tagged to **OPTIONS** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -508,8 +508,8 @@ class Blueprint: :param uri: URL to be tagged to **PATCH** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method @@ -532,8 +532,8 @@ class Blueprint: :param uri: URL to be tagged to **DELETE** method of *HTTP* :param host: Host IP or FQDN for the service to use - :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check if the request - URLs need to terminate with a */* + :param strict_slashes: Instruct :class:`sanic.app.Sanic` to check + if the request URLs need to terminate with a */* :param version: API Version :param name: Unique name that can be used to identify the Route :return: Object decorated with :func:`route` method diff --git a/sanic/handlers.py b/sanic/handlers.py index 8bd2cbe9..65e3f0b1 100644 --- a/sanic/handlers.py +++ b/sanic/handlers.py @@ -26,10 +26,11 @@ class ErrorHandler: This error handling framework is built into the core that can be extended by the developers to perform a wide range of tasks from recording the error - stats to reporting them to an external service that can be used for realtime - alerting system. + stats to reporting them to an external service that can be used for + realtime alerting system. """ + handlers = None cached_handlers = None _missing = object() @@ -75,7 +76,8 @@ class ErrorHandler: :param exception: Type of exception that need to be handled :param handler: Reference to the method that will handle the exception - :type exception: :class:`sanic.exceptions.SanicException` or :class:`Exception` + :type exception: :class:`sanic.exceptions.SanicException` or + :class:`Exception` :type handler: ``function`` :return: None @@ -91,7 +93,8 @@ class ErrorHandler: :param exception: Type of exception - :type exception: :class:`sanic.exceptions.SanicException` or :class:`Exception` + :type exception: :class:`sanic.exceptions.SanicException` or + :class:`Exception` :return: Registered function if found ``None`` otherwise """ @@ -113,7 +116,8 @@ class ErrorHandler: :param exception: Exception to handle :type request: :class:`sanic.request.Request` - :type exception: :class:`sanic.exceptions.SanicException` or :class:`Exception` + :type exception: :class:`sanic.exceptions.SanicException` or + :class:`Exception` :return: Wrap the return value obtained from :func:`default` or registered handler for that type of exception. @@ -158,7 +162,8 @@ class ErrorHandler: :param exception: Exception object :type request: :class:`sanic.request.Request` - :type exception: :class:`sanic.exceptions.SanicException` or :class:`Exception` + :type exception: :class:`sanic.exceptions.SanicException` or + :class:`Exception` :return: """ self.log(format_exc())