This commit is contained in:
2025-02-11 22:48:36 +03:00
parent 6d331a57c1
commit 29b184b2ed
4 changed files with 26 additions and 10 deletions
+4 -4
View File
@@ -4,8 +4,8 @@ from .exceptions import (InvalidRouterInstanceException,
InvalidDescriptionMessagePatternException,
OnlyOneMainRouterIsAllowedException,
MissingMainRouterException,
MissingHandlersForUnknownCommandsOnMainRouterException,
HandlerForUnknownCommandsCanOnlyBeDeclaredForMainRouterException,
MissingHandlerForUnknownCommandsException,
HandlerForUnknownCommandsOnNonMainRouterException,
NoRegisteredRoutersException,
NoRegisteredHandlersException,
RepeatedCommandInDifferentRoutersException)
@@ -152,11 +152,11 @@ class App:
self._app_main_router = router
if not self._app_main_router.unknown_command_func:
raise MissingHandlersForUnknownCommandsOnMainRouterException()
raise MissingHandlerForUnknownCommandsException()
for router in self._routers:
if router.unknown_command_func and self._app_main_router is not router:
raise HandlerForUnknownCommandsCanOnlyBeDeclaredForMainRouterException()
raise HandlerForUnknownCommandsOnNonMainRouterException()
def _validate_all_router_commands(self) -> None: