Changeset - cfce400b9684
[Not reviewed]
stable
0 2 0
Mads Kiilerich - 6 years ago 2020-04-24 12:42:29
mads@kiilerich.com
Grafted from: cd3f17424229
tg: clarify how ErrorController hooks into TG without using config/middleware.py
2 files changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/error.py
Show inline comments
 
@@ -38,17 +38,14 @@ from kallithea.lib.base import BaseContr
 
log = logging.getLogger(__name__)
 

	
 

	
 
class ErrorController(BaseController):
 
    """Generates error documents as and when they are required.
 

	
 
    The ErrorDocuments middleware forwards to ErrorController when error
 
    The errorpage middleware renders /error/document when error
 
    related status codes are returned from the application.
 

	
 
    This behavior can be altered by changing the parameters to the
 
    ErrorDocuments middleware in your config/middleware.py file.
 
    """
 

	
 
    def _before(self, *args, **kwargs):
 
        # disable all base actions since we don't need them here
 
        pass
 

	
kallithea/controllers/root.py
Show inline comments
 
@@ -28,8 +28,8 @@ from kallithea.lib.base import BaseContr
 
# inheriting from its RoutedController class.
 
class RootController(RoutedController, BaseController):
 

	
 
    def __init__(self):
 
        self.mapper = make_map(config)
 

	
 
        # the following assignment hooks in error handling
 
        # The URL '/error/document' (the default TG errorpage.path) should be handled by ErrorController.document
 
        self.error = ErrorController()
0 comments (0 inline, 0 general)