File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
aws_lambda_powertools/utilities/batch Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Batch processing exceptions
3
3
"""
4
+ from __future__ import annotations
5
+
4
6
import traceback
5
7
from types import TracebackType
6
8
from typing import List , Optional , Tuple , Type
9
11
10
12
11
13
class BaseBatchProcessingError (Exception ):
12
- def __init__ (self , msg = "" , child_exceptions : Optional [ List [ExceptionInfo ]] = None ):
14
+ def __init__ (self , msg = "" , child_exceptions : List [ExceptionInfo ] | None = None ):
13
15
super ().__init__ (msg )
14
16
self .msg = msg
15
- self .child_exceptions = child_exceptions
17
+ self .child_exceptions = child_exceptions or []
16
18
17
19
def format_exceptions (self , parent_exception_str ):
18
20
exception_list = [f"{ parent_exception_str } \n " ]
@@ -27,7 +29,7 @@ def format_exceptions(self, parent_exception_str):
27
29
class BatchProcessingError (BaseBatchProcessingError ):
28
30
"""When all batch records failed to be processed"""
29
31
30
- def __init__ (self , msg = "" , child_exceptions : Optional [ List [ExceptionInfo ]] = None ):
32
+ def __init__ (self , msg = "" , child_exceptions : List [ExceptionInfo ] | None = None ):
31
33
super ().__init__ (msg , child_exceptions )
32
34
33
35
def __str__ (self ):
You can’t perform that action at this time.
0 commit comments