@@ -46,9 +46,9 @@ def wrapper(self: Any, event: MutableMapping[str, Any], context: Any) -> Any:
4646 try :
4747 response = entrypoint (self , event , context )
4848 serialized = json .dumps (response , cls = KitchenSinkEncoder )
49- except Exception as e : # pylint: disable=broad-except
49+ except Exception : # pylint: disable=broad-except
5050 return ProgressEvent .failed ( # pylint: disable=protected-access
51- HandlerErrorCode .InternalFailure , str ( e )
51+ HandlerErrorCode .InternalFailure
5252 )._serialize ()
5353 return json .loads (serialized )
5454
@@ -121,12 +121,10 @@ def test_entrypoint(
121121 except _HandlerError as e :
122122 LOG .exception ("Handler error" )
123123 return e .to_progress_event ()
124- except Exception as e : # pylint: disable=broad-except
124+ except Exception : # pylint: disable=broad-except
125125 LOG .exception ("Exception caught" )
126- msg = str (e )
127- except BaseException as e : # pylint: disable=broad-except
126+ except BaseException : # pylint: disable=broad-except
128127 LOG .critical ("Base exception caught (this is usually bad)" , exc_info = True )
129- msg = str (e )
130128 return ProgressEvent .failed (HandlerErrorCode .InternalFailure , msg )
131129
132130 @staticmethod
@@ -214,11 +212,11 @@ def print_or_log(message: str) -> None:
214212 print_or_log ("Handler error" )
215213 progress = e .to_progress_event ()
216214 except Exception as e : # pylint: disable=broad-except
217- print_or_log ("Exception caught" )
218- progress = ProgressEvent .failed (HandlerErrorCode .InternalFailure , str ( e ) )
215+ print_or_log ("Exception caught {0}" . format ( e ) )
216+ progress = ProgressEvent .failed (HandlerErrorCode .InternalFailure )
219217 except BaseException as e : # pylint: disable=broad-except
220- print_or_log ("Base exception caught (this is usually bad)" )
221- progress = ProgressEvent .failed (HandlerErrorCode .InternalFailure , str ( e ) )
218+ print_or_log ("Base exception caught (this is usually bad) {0}" . format ( e ) )
219+ progress = ProgressEvent .failed (HandlerErrorCode .InternalFailure )
222220
223221 # use the raw event_data as a last-ditch attempt to call back if the
224222 # request is invalid
0 commit comments