@@ -40,7 +40,7 @@ class ActionThread(threading.Thread):
4040 * The exception appearing in the logs with a traceback
4141 * The exception being raised in the background thread.
4242 However, `HTTPException` subclasses are used in Flask/Werkzeug web apps to
43- return HTTP status codes indicating specific errors, and so merit being
43+ return HTTP status codes indicating specific errors, and so merit being
4444 handled differently.
4545
4646 Normally, when an Action is initiated, the thread handling the HTTP request
@@ -49,14 +49,14 @@ class ActionThread(threading.Thread):
4949 in the Action thread before the initiating thread has sent an HTTP response,
5050 we **don't** want to propagate the error here, but instead want to re-raise
5151 it in the calling thread. This will then mean that the HTTP request is
52- answered with the appropriate error code, rather than returning a `201`
52+ answered with the appropriate error code, rather than returning a `201`
5353 code, along with a description of the task (showing that it was successfully
5454 started, but also showing that it subsequently failed with an error).
5555
56- In order to activate this behaviour, we must pass in a `threading.Lock`
56+ In order to activate this behaviour, we must pass in a `threading.Lock`
5757 object. This lock should already be acquired by the request-handling
5858 thread. If an error occurs, and this lock is acquired, the exception
59- should not be re-raised until the calling thread has had the chance to deal
59+ should not be re-raised until the calling thread has had the chance to deal
6060 with it.
6161 """
6262
@@ -70,7 +70,7 @@ def __init__(
7070 daemon : bool = True ,
7171 default_stop_timeout : int = 5 ,
7272 log_len : int = 100 ,
73- http_error_lock : Optional [threading .Lock ] = None
73+ http_error_lock : Optional [threading .Lock ] = None ,
7474 ):
7575 threading .Thread .__init__ (
7676 self ,
@@ -271,8 +271,6 @@ def wrapped(*args, **kwargs):
271271 )
272272 logging .error (traceback .format_exc ())
273273 raise e
274- else :
275- logging .info (f"Propagating { e } back to request handler" )
276274 except Exception as e : # skipcq: PYL-W0703
277275 self ._exception = e
278276 logging .error (traceback .format_exc ())
@@ -285,7 +283,6 @@ def wrapped(*args, **kwargs):
285283 self ._return_value = str (self ._exception )
286284 self ._status = "error"
287285
288-
289286 return wrapped
290287
291288 def get (self , block : bool = True , timeout : Optional [int ] = None ):
0 commit comments