From a25ede147fef18ad0bc75c6ba526ac01430b2e87 Mon Sep 17 00:00:00 2001 From: kolo Date: Fri, 17 Oct 2025 01:09:06 +0300 Subject: [PATCH] docs: continue making docs --- .../error_handling_example_sample6.py | 7 + docs/conf.py | 7 + .../en/LC_MESSAGES/root/api/command/flags.po | 14 +- .../en/LC_MESSAGES/root/api/command/index.po | 8 +- .../en/LC_MESSAGES/root/error_handling.po | 440 ++++++++++++------ docs/root/error_handling.rst | 32 +- 6 files changed, 357 insertions(+), 151 deletions(-) create mode 100644 docs/code_snippets/error_handling_example_sample6.py diff --git a/docs/code_snippets/error_handling_example_sample6.py b/docs/code_snippets/error_handling_example_sample6.py new file mode 100644 index 0000000..b14f60b --- /dev/null +++ b/docs/code_snippets/error_handling_example_sample6.py @@ -0,0 +1,7 @@ +from argenta import App, Response + +def exit_command_handler(response: Response): + print("Exit command handler") + +app: App = App() +app.set_exit_command_handler(exit_command_handler) diff --git a/docs/conf.py b/docs/conf.py index 25c15ef..dc48351 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,6 +28,13 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] html_theme = "shibuya" html_static_path = ["_static"] +html_context = { + "languages": [ + ("English", "/en/latest/%s/", "en"), + ("Русский", "/ru/latest/%s/", "ru"), + ] +} + html_theme_options = { "accent_color": "cyan", "nav_links": [ diff --git a/docs/locales/en/LC_MESSAGES/root/api/command/flags.po b/docs/locales/en/LC_MESSAGES/root/api/command/flags.po index 31c4f77..8d36684 100644 --- a/docs/locales/en/LC_MESSAGES/root/api/command/flags.po +++ b/docs/locales/en/LC_MESSAGES/root/api/command/flags.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Argenta \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 16:09+0300\n" +"POT-Creation-Date: 2025-10-16 23:51+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -23,3 +23,15 @@ msgstr "" msgid "Flags" msgstr "" +#: ../../root/api/command/flags.rst:8 +msgid "Flag" +msgstr "" + +#: ../../root/api/command/flags.rst:12 +msgid "InputFlags" +msgstr "" + +#: ../../root/api/command/flags.rst:18 +msgid "InputFlag" +msgstr "" + diff --git a/docs/locales/en/LC_MESSAGES/root/api/command/index.po b/docs/locales/en/LC_MESSAGES/root/api/command/index.po index c9c826c..2a3b756 100644 --- a/docs/locales/en/LC_MESSAGES/root/api/command/index.po +++ b/docs/locales/en/LC_MESSAGES/root/api/command/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Argenta \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 16:09+0300\n" +"POT-Creation-Date: 2025-10-16 23:51+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -19,7 +19,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.17.0\n" -#: ../../root/api/command/index.rst:2 +#: ../../root/api/command/index.rst:4 msgid "Command" msgstr "" +#: ../../root/api/command/index.rst:16 +msgid "InputCommand" +msgstr "" + diff --git a/docs/locales/en/LC_MESSAGES/root/error_handling.po b/docs/locales/en/LC_MESSAGES/root/error_handling.po index 17b66dc..cbad9fc 100644 --- a/docs/locales/en/LC_MESSAGES/root/error_handling.po +++ b/docs/locales/en/LC_MESSAGES/root/error_handling.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Argenta \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-16 17:03+0300\n" +"POT-Creation-Date: 2025-10-16 23:51+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -29,199 +29,353 @@ msgstr "" #: ../../root/error_handling.rst:7 msgid "" -"``Argenta`` в рантайме вызывает исключения в пограничных случаях. " -"Подробнее о типах исключений :ref:`ниже `. Все " -"исключения обрабатываются системными хэндлерами, но у вас есть " -"возможность их переопределить. Переопределение осуществляется с помощью " -"сеттеров инстанса ``App`` - ``.set_*_handler(_)``, где ``_`` - это " -"протокол хэндлера нестандартного поведения, подробнее о каждом протоколе " -"и соответствующем сеттере :ref:`ниже `" +"``Argenta`` в рантайме вызывает исключения в пограничных случаях " +"пользовательского ввода. Все исключения обрабатываются системными " +"хэндлерами, но у вас есть возможность их переопределить. Переопределение " +"осуществляется с помощью сеттеров инстанса ``App`` - " +"``.set_*_handler(_)``, где ``_`` - это протокол хэндлера нестандартного " +"поведения, подробнее о каждом протоколе и соответствующем сеттере " +":ref:`ниже `" msgstr "" -#: ../../root/error_handling.rst:12 +#: ../../root/error_handling.rst:13 +msgid "" +"Все исключения никогда не остаются необработанными, так как у них есть " +"стандартные хэндлеры. Поэтому переопределение опционально." +msgstr "" + +#: ../../root/error_handling.rst:15 msgid "Краткий сэмпл кода, переопределяющего хэндлер ввода пустой команды" msgstr "" -#: ../../root/error_handling.rst:21 +#: ../../root/error_handling.rst:25 msgid "Возможные исключения" msgstr "" -#: ../../root/error_handling.rst:24 -msgid "UnprocessedInputFlagException: Необрабатываемый ввод от пользователя" +#: ../../root/error_handling.rst:28 +msgid "``UnprocessedInputFlagException``: Необрабатываемый ввод от пользователя" msgstr "" -#: ../../root/error_handling.rst:26 +#: ../../root/error_handling.rst:30 msgid "" "Исключение вызывается, когда пользователь вводит команду с некорректным " "синтаксисом и парсер не может *распарсить* её. В большинстве случаев это " -"означат, что проблема в синтаксисе введённых флагов команды, подробнее в" +"означат, что проблема в синтаксисе введённых флагов команды, подробнее о " +"флагах и их синтаксисе в :ref:`Flags `." msgstr "" -#: ../../root/error_handling.rst:38 +#: ../../root/error_handling.rst:34 ../../root/error_handling.rst:57 +#: ../../root/error_handling.rst:79 ../../root/error_handling.rst:102 +msgid "Дефолтный хэндлер выводит в консоль" +msgstr "" + +#: ../../root/error_handling.rst:40 msgid "" -"This error means that one of the objects cannot be created because some " -"of its dependencies depend on itself. You can see the whole path in the " -"error message with types and provider methods." -msgstr "" - -#: ../../root/error_handling.rst:42 -msgid "Possible actions:" +"Для переопределения стандартного поведения используется сеттер " +"``.set_incorrect_input_syntax_handler(_: " +"NonStandardBehaviorHandler[str])``, протокол " +"``NonStandardBehaviorHandler[str]`` соответствует ``Callable[[str], " +"None]``, то есть хэндлер должен быть вызываемым объектом, к примеру " +"функция или лямбда, которая принимает единственный аргумент - строку, " +"которая представляет собой необработанную введённую команду, и ничего не " +"возвращает." msgstr "" #: ../../root/error_handling.rst:44 msgid "" -"**Remove cycle dependency.** If the cycle was introduced as a result of " -"typo you can fix it. But in other cases this can lead to a refactoring of" -" your object structure" +"Сэмпл кода, переопределяющего хэндлер ввода команды с некорректным " +"синтаксисом:" msgstr "" -#: ../../root/error_handling.rst:48 +#: ../../root/error_handling.rst:52 +msgid "``RepeatedInputFlagsException``: Повторяющийся флаг в введённой команде" +msgstr "" + +#: ../../root/error_handling.rst:54 msgid "" -"**Implement two-phase initialization.** Instead of doing constructor " -"injection using dishka you can do attribute injection later when both " -"objects are available." +"Исключение вызывается, когда пользователь вводит команду с повторяющимся " +"флагом, флаг(:ref:`InputFlag `) считается повторяющимся, если" +" введён флаг с таким же именем, именно именем, без префикса. Подробнее о " +"флагах и их синтаксисе в :ref:`Flags `." msgstr "" -#: ../../root/error_handling.rst:53 -msgid "GraphMissingFactoryError: Cannot find factory for ..." -msgstr "" - -#: ../../root/error_handling.rst:64 +#: ../../root/error_handling.rst:63 msgid "" -"There are multiple reasons for this error. If possible, dishka tries to " -"predict possible fixes." +"Для переопределения стандартного поведения используется сеттер " +"``.set_repeated_input_flags_handler(_: " +"NonStandardBehaviorHandler[str])``, протокол " +"``NonStandardBehaviorHandler[str]`` соответствует ``Callable[[str], " +"None]``, то есть хэндлер должен быть вызываемым объектом, к примеру " +"функция или лямбда, которая принимает единственный аргумент - строку, " +"которая представляет собой необработанную введённую команду, и ничего не " +"возвращает." msgstr "" -#: ../../root/error_handling.rst:66 +#: ../../root/error_handling.rst:67 msgid "" -"**Factory is simply missing.** Check that you added all required " -"providers and they contain appropriate ``provide``." +"Сэмпл кода, переопределяющего хэндлер ввода команды с повторяющимися " +"флагами:" msgstr "" -#: ../../root/error_handling.rst:69 -msgid "" -"**Context data is not marked with from_context** Check that you added all" -" required providers and they contain appropriate ``from_context``." -msgstr "" - -#: ../../root/error_handling.rst:72 -msgid "" -"**Object has invalid scope** Check the scope of provided type and the " -"types dependent on it. Note, that long-living objects cannot depend on " -"short-living ones. E.g. object with ``Scope.APP`` cannot depend on one " -"with ``Scope.REQUEST``." +#: ../../root/error_handling.rst:75 +msgid "``EmptyInputCommandException``: Введена пустая команда" msgstr "" #: ../../root/error_handling.rst:77 -msgid "You should review used scopes." -msgstr "" - -#: ../../root/error_handling.rst:79 msgid "" -"**Object is provided in another component** Components are isolated and " -"cannot implicitly share objects. You should either use ``FromComponent`` " -"to call another component directly or create object separately for " -"appropriate component using ``provide`` annotation" +"Исключение вызывается, когда пользователь вводит команду в виде строки из" +" пробельных символов - ``\\n``, ``\\t``, пробел и т.д." msgstr "" -#: ../../root/error_handling.rst:84 +#: ../../root/error_handling.rst:85 msgid "" -"**Dependency is parent class while provided child class (or vice versa)**" -" Use ``provides=`` argument to mark that source and provided types are " -"different. Use ``WithParents[X]`` to provide an object as its type with " -"parent classes" +"Для переопределения стандартного поведения используется сеттер " +"``.set_empty_command_handler(_: EmptyCommandHandler)``, протокол " +"``EmptyCommandHandler`` соответствует ``Callable[[], None]``, то есть " +"хэндлер должен быть вызываемым объектом, к примеру функция или лямбда, " +"которая не принимает аргументов и ничего не возвращает." msgstr "" -#: ../../root/error_handling.rst:90 -msgid "CannotUseProtocolError: Cannot use ... as a factory" +#: ../../root/error_handling.rst:89 +msgid "Сэмпл кода, переопределяющего хэндлер ввода пустой команды:" msgstr "" #: ../../root/error_handling.rst:97 +msgid "``UnknownCommandException``: Введена неизвестная команда" +msgstr "" + +#: ../../root/error_handling.rst:99 msgid "" -"This error means that you used some protocol class as a source argument " -"of ``provide`` function. Protocols cannot be instantiated. Check that you" -" have an implementation for that protocol, and use it. You can try using " -"the form ``provide(YourImpl, provides=YourProtocol)``." +"Исключение вызывается, когда пользователь вводит команду, которая не " +"зарегистрирована ни в одном роутере и не является алиасом ни для одной " +"зарегистрированной команды." msgstr "" -#: ../../root/error_handling.rst:104 -msgid "NotAFactoryError: Cannot use ... as a factory." -msgstr "" - -#: ../../root/error_handling.rst:111 +#: ../../root/error_handling.rst:108 msgid "" -"Check what are you passing to ``provide`` function. Probably that object " -"cannot be instantiated directly." +"Для переопределения стандартного поведения используется сеттер " +"``.set_unknown_command_handler(_: " +"NonStandardBehaviorHandler[InputCommand])``, протокол " +"``NonStandardBehaviorHandler[InputCommand]`` соответствует " +"``Callable[[InputCommand], None]``, то есть хэндлер должен быть " +"вызываемым объектом, к примеру функция или лямбда, которая принимает " +"обязательный аргумент типа :ref:`InputCommand ` и ничего " +"не возвращает." msgstr "" -#: ../../root/error_handling.rst:113 -msgid "" -"Note, that you can provide some type by creating an instance of another " -"one using the form ``provide(YourClass, provides=SomeTypeHint)``." -msgstr "" - -#: ../../root/error_handling.rst:117 -msgid "ImplicitOverrideDetectedError: Detected multiple factories for ..." -msgstr "" - -#: ../../root/error_handling.rst:126 -msgid "" -"This error can be seen only if you enabled ``implicit_override=True`` in " -"validation settings. It means that you have 2 factories for the same type" -" without specifying that the second one should replace the first one." -msgstr "" - -#: ../../root/error_handling.rst:129 -msgid "**You meant to have one of factories**. Just remove the second one." -msgstr "" - -#: ../../root/error_handling.rst:131 -msgid "" -"**You want to override dependency for tests or other purposes**. Specify " -"``override=True`` when creating second factory." -msgstr "" - -#: ../../root/error_handling.rst:133 -msgid "Error text will contain details on both option with names of providers." -msgstr "" - -#: ../../root/error_handling.rst:137 -msgid "" -"NothingOverriddenError: Overriding factory found for ..., but there is " -"nothing to override." -msgstr "" - -#: ../../root/error_handling.rst:146 -msgid "" -"This error can be seen only if you enabled ``nothing_overridden=True`` in" -" validation settings. That means you set ``override=True``, but there is " -"no second factory to be overriden or the order of providers is incorrect." -msgstr "" - -#: ../../root/error_handling.rst:149 -msgid "" -"Check, that you have specified all expected providers in correct order or" -" remove the flag." -msgstr "" - -#: ../../root/error_handling.rst:153 -msgid "IndependentDecoratorError: Decorator ... does not depend on provided type." -msgstr "" - -#: ../../root/error_handling.rst:160 -msgid "" -"Using ``decorate`` is a special case if you need to apply decorator " -"patter or do modifications with an object created in another provider. Is" -" requests an object of some type (additional dependencies are allowed) " -"and returns the same type." -msgstr "" - -#: ../../root/error_handling.rst:163 -msgid "" -"If you are not going to use an object received from another factory, " -"probably you meant to use simple ``provide`` instead?" +#: ../../root/error_handling.rst:112 +msgid "Сэмпл кода, переопределяющего хэндлер ввода неизвестной команды:" msgstr "" #~ msgid "привет" #~ msgstr "" +#~ msgid "" +#~ "``Argenta`` в рантайме вызывает исключения " +#~ "в пограничных случаях. Подробнее о типах" +#~ " исключений :ref:`ниже `. Все" +#~ " исключения обрабатываются системными хэндлерами," +#~ " но у вас есть возможность их " +#~ "переопределить. Переопределение осуществляется с " +#~ "помощью сеттеров инстанса ``App`` - " +#~ "``.set_*_handler(_)``, где ``_`` - это " +#~ "протокол хэндлера нестандартного поведения, " +#~ "подробнее о каждом протоколе и " +#~ "соответствующем сеттере :ref:`ниже " +#~ "`" +#~ msgstr "" + +#~ msgid "UnprocessedInputFlagException: Необрабатываемый ввод от пользователя" +#~ msgstr "" + +#~ msgid "" +#~ "Исключение вызывается, когда пользователь " +#~ "вводит команду с некорректным синтаксисом " +#~ "и парсер не может *распарсить* её. " +#~ "В большинстве случаев это означат, что" +#~ " проблема в синтаксисе введённых флагов " +#~ "команды, подробнее в" +#~ msgstr "" + +#~ msgid "" +#~ "This error means that one of the" +#~ " objects cannot be created because " +#~ "some of its dependencies depend on " +#~ "itself. You can see the whole path" +#~ " in the error message with types " +#~ "and provider methods." +#~ msgstr "" + +#~ msgid "Possible actions:" +#~ msgstr "" + +#~ msgid "" +#~ "**Remove cycle dependency.** If the " +#~ "cycle was introduced as a result " +#~ "of typo you can fix it. But " +#~ "in other cases this can lead to" +#~ " a refactoring of your object " +#~ "structure" +#~ msgstr "" + +#~ msgid "" +#~ "**Implement two-phase initialization.** " +#~ "Instead of doing constructor injection " +#~ "using dishka you can do attribute " +#~ "injection later when both objects are" +#~ " available." +#~ msgstr "" + +#~ msgid "GraphMissingFactoryError: Cannot find factory for ..." +#~ msgstr "" + +#~ msgid "" +#~ "There are multiple reasons for this " +#~ "error. If possible, dishka tries to " +#~ "predict possible fixes." +#~ msgstr "" + +#~ msgid "" +#~ "**Factory is simply missing.** Check " +#~ "that you added all required providers" +#~ " and they contain appropriate ``provide``." +#~ msgstr "" + +#~ msgid "" +#~ "**Context data is not marked with " +#~ "from_context** Check that you added all" +#~ " required providers and they contain " +#~ "appropriate ``from_context``." +#~ msgstr "" + +#~ msgid "" +#~ "**Object has invalid scope** Check the" +#~ " scope of provided type and the " +#~ "types dependent on it. Note, that " +#~ "long-living objects cannot depend on " +#~ "short-living ones. E.g. object with " +#~ "``Scope.APP`` cannot depend on one with" +#~ " ``Scope.REQUEST``." +#~ msgstr "" + +#~ msgid "You should review used scopes." +#~ msgstr "" + +#~ msgid "" +#~ "**Object is provided in another " +#~ "component** Components are isolated and " +#~ "cannot implicitly share objects. You " +#~ "should either use ``FromComponent`` to " +#~ "call another component directly or " +#~ "create object separately for appropriate " +#~ "component using ``provide`` annotation" +#~ msgstr "" + +#~ msgid "" +#~ "**Dependency is parent class while " +#~ "provided child class (or vice versa)**" +#~ " Use ``provides=`` argument to mark " +#~ "that source and provided types are " +#~ "different. Use ``WithParents[X]`` to provide" +#~ " an object as its type with " +#~ "parent classes" +#~ msgstr "" + +#~ msgid "CannotUseProtocolError: Cannot use ... as a factory" +#~ msgstr "" + +#~ msgid "" +#~ "This error means that you used " +#~ "some protocol class as a source " +#~ "argument of ``provide`` function. Protocols" +#~ " cannot be instantiated. Check that " +#~ "you have an implementation for that " +#~ "protocol, and use it. You can try" +#~ " using the form ``provide(YourImpl, " +#~ "provides=YourProtocol)``." +#~ msgstr "" + +#~ msgid "NotAFactoryError: Cannot use ... as a factory." +#~ msgstr "" + +#~ msgid "" +#~ "Check what are you passing to " +#~ "``provide`` function. Probably that object " +#~ "cannot be instantiated directly." +#~ msgstr "" + +#~ msgid "" +#~ "Note, that you can provide some " +#~ "type by creating an instance of " +#~ "another one using the form " +#~ "``provide(YourClass, provides=SomeTypeHint)``." +#~ msgstr "" + +#~ msgid "ImplicitOverrideDetectedError: Detected multiple factories for ..." +#~ msgstr "" + +#~ msgid "" +#~ "This error can be seen only if " +#~ "you enabled ``implicit_override=True`` in " +#~ "validation settings. It means that you" +#~ " have 2 factories for the same " +#~ "type without specifying that the second" +#~ " one should replace the first one." +#~ msgstr "" + +#~ msgid "**You meant to have one of factories**. Just remove the second one." +#~ msgstr "" + +#~ msgid "" +#~ "**You want to override dependency for" +#~ " tests or other purposes**. Specify " +#~ "``override=True`` when creating second " +#~ "factory." +#~ msgstr "" + +#~ msgid "Error text will contain details on both option with names of providers." +#~ msgstr "" + +#~ msgid "" +#~ "NothingOverriddenError: Overriding factory found " +#~ "for ..., but there is nothing to" +#~ " override." +#~ msgstr "" + +#~ msgid "" +#~ "This error can be seen only if " +#~ "you enabled ``nothing_overridden=True`` in " +#~ "validation settings. That means you set" +#~ " ``override=True``, but there is no " +#~ "second factory to be overriden or " +#~ "the order of providers is incorrect." +#~ msgstr "" + +#~ msgid "" +#~ "Check, that you have specified all " +#~ "expected providers in correct order or" +#~ " remove the flag." +#~ msgstr "" + +#~ msgid "" +#~ "IndependentDecoratorError: Decorator ... does " +#~ "not depend on provided type." +#~ msgstr "" + +#~ msgid "" +#~ "Using ``decorate`` is a special case " +#~ "if you need to apply decorator " +#~ "patter or do modifications with an " +#~ "object created in another provider. Is" +#~ " requests an object of some type " +#~ "(additional dependencies are allowed) and " +#~ "returns the same type." +#~ msgstr "" + +#~ msgid "" +#~ "If you are not going to use " +#~ "an object received from another factory," +#~ " probably you meant to use simple " +#~ "``provide`` instead?" +#~ msgstr "" + diff --git a/docs/root/error_handling.rst b/docs/root/error_handling.rst index 5e3274b..819621e 100644 --- a/docs/root/error_handling.rst +++ b/docs/root/error_handling.rst @@ -21,8 +21,8 @@ .. _possible_errors: -Возможные исключения --------------------- +Возможные исключения и нестандартное поведение +---------------------------------------------- ``UnprocessedInputFlagException``: Необрабатываемый ввод от пользователя ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -93,10 +93,10 @@ --------------- -``UnknownCommandException``: Введена неизвестная команда -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``Поведение обработки неизвестной команды``: Введена неизвестная команда +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Исключение вызывается, когда пользователь вводит команду, которая не зарегистрирована ни в одном роутере и не является алиасом ни для +Поведение триггерится, когда пользователь вводит команду, которая не зарегистрирована ни в одном роутере и не является алиасом ни для одной зарегистрированной команды. Дефолтный хэндлер выводит в консоль @@ -113,4 +113,26 @@ .. literalinclude:: ../code_snippets/error_handling_example_sample5.py :language: python + +--------------- + +``Поведение выхода из приложения``: Введена команда выхода +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Поведение триггерится, когда пользователь вводит команду, которая маркирована как команда завершения работы. + +Дефолтный хэндлер выводит в консоль текст и завершает работу приложения. + +.. code-block:: shell + + See you + +Для переопределения стандартного поведения используется сеттер ``.set_exit_command_handler(_: NonStandardBehaviorHandler[Response])``, +протокол ``NonStandardBehaviorHandler[Response]`` соответствует ``Callable[[Response], None]``, то есть хэндлер должен быть вызываемым объектом, +к примеру функция или лямбда, которая принимает обязательный аргумент типа :ref:`Response ` и ничего не возвращает. + +Сэмпл кода, переопределяющего хэндлер ввода команды выхода: + +.. literalinclude:: ../code_snippets/error_handling_example_sample6.py + :language: python \ No newline at end of file