1717 SendErrorExplainToUserHandler ,
1818)
1919from app .presentation .bot .error_handlers .exceptions_chain_executor import (
20- DEFAULT_HANDLERS ,
21- ExceptionHandlersChainExecutor , DEFAULT_HANDLERS_WITH_EXPLAIN ,
20+ DEFAULT_HANDLERS_WITH_EXPLAIN ,
21+ ExceptionHandlersChainExecutor ,
2222)
2323from app .presentation .bot .resources .strings import (
2424 SAMPLE_RECORD_CREATED_ANSWER ,
@@ -48,9 +48,6 @@ class CreateSampleRecordHandler(BaseCommandHandler):
4848 }
4949 )
5050 ]
51- exception_handler_chain_executor = ExceptionHandlersChainExecutor (
52- _EXCEPTIONS_HANDLERS
53- )
5451
5552 def __init__ (
5653 self ,
@@ -62,7 +59,11 @@ def __init__(
6259 self ._use_cases = use_case_factory
6360 self .unit_of_work = unit_of_work
6461
65- super ().__init__ (bot , message , self .exception_handler_chain_executor )
62+ exception_handler_chain_executor = ExceptionHandlersChainExecutor (
63+ self ._EXCEPTIONS_HANDLERS
64+ )
65+
66+ super ().__init__ (bot , message , exception_handler_chain_executor )
6667
6768 async def handle_logic (
6869 self ,
@@ -94,9 +95,6 @@ class DeleteSampleRecordHandler(BaseCommandHandler):
9495 }
9596 )
9697 ]
97- exception_handler_chain_executor = ExceptionHandlersChainExecutor (
98- _EXCEPTIONS_HANDLERS
99- )
10098
10199 def __init__ (
102100 self ,
@@ -107,8 +105,11 @@ def __init__(
107105 ):
108106 self ._use_cases = use_case_factory
109107 self .unit_of_work = unit_of_work
108+ exception_handler_chain_executor = ExceptionHandlersChainExecutor (
109+ self ._EXCEPTIONS_HANDLERS
110+ )
110111
111- super ().__init__ (bot , message , self . exception_handler_chain_executor )
112+ super ().__init__ (bot , message , exception_handler_chain_executor )
112113
113114 async def handle_logic (
114115 self ,
@@ -153,7 +154,11 @@ def __init__(
153154 self ._use_cases = use_case_factory
154155 self .unit_of_work = unit_of_work
155156
156- super ().__init__ (bot , message , self .exception_handler_chain_executor )
157+ exception_handler_chain_executor = ExceptionHandlersChainExecutor (
158+ self ._EXCEPTIONS_HANDLERS
159+ )
160+
161+ super ().__init__ (bot , message , exception_handler_chain_executor )
157162
158163 async def handle_logic (
159164 self ,
0 commit comments