@@ -184,12 +184,7 @@ def hook(self, buffer, *args, **kwargs):
184
184
f"RECV_INTO - self={ self } id={ id (self )} socketdata={ socketdata } args={ args } kwargs={ kwargs } "
185
185
)
186
186
187
- try :
188
- nbytes = method (self , buffer , * args , ** kwargs )
189
- except Exception as ex :
190
- if socketdata and socketdata .record :
191
- socketdata .record .exception = ex
192
- raise
187
+ nbytes = method (self , buffer , * args , ** kwargs )
193
188
194
189
if socketdata :
195
190
if socketdata .record :
@@ -241,12 +236,7 @@ def hook(self, bufsize, *args, **kwargs):
241
236
f"RECV - self={ self } id={ id (self )} socketdata={ socketdata } bufsize={ bufsize } args={ args } kwargs={ kwargs } "
242
237
)
243
238
244
- try :
245
- buffer = method (self , bufsize , * args , ** kwargs )
246
- except Exception as ex :
247
- if socketdata and socketdata .record :
248
- socketdata .record .exception = ex
249
- raise
239
+ buffer = method (self , bufsize , * args , ** kwargs )
250
240
251
241
if socketdata and socketdata .record :
252
242
socketdata .record .receive_data (buffer )
@@ -298,12 +288,8 @@ def hook(self, data, *args, **kwargs):
298
288
records .requests [socketdata .record .id ] = socketdata .record
299
289
elif http_detected is False : # if None, there is nothing to do
300
290
records ._sockets [id (self )] = None
301
- try :
302
- return method (self , data , * args , ** kwargs )
303
- except Exception as ex :
304
- if socketdata and socketdata .record :
305
- socketdata .record .exception = ex
306
- raise
291
+
292
+ return method (self , data , * args , ** kwargs )
307
293
308
294
return hook
309
295
@@ -320,12 +306,7 @@ def hook(self, data, *args, **kwargs):
320
306
f"SEND - self={ self } id={ id (self )} socketdata={ socketdata } bytes={ (b'' + data )[:20 ]} args={ args } kwargs={ kwargs } "
321
307
)
322
308
323
- try :
324
- size = method (self , data , * args , ** kwargs )
325
- except Exception as ex :
326
- if socketdata and socketdata .record :
327
- socketdata .record .exception = ex
328
- raise
309
+ size = method (self , data , * args , ** kwargs )
329
310
330
311
if socketdata :
331
312
if socketdata .record :
@@ -399,12 +380,7 @@ def hook(self, buf, *args, **kwargs):
399
380
if socketdata :
400
381
logger ().info (f"WRITE * - socketdata={ socketdata } " )
401
382
402
- try :
403
- size = method (self , buf , * args , ** kwargs )
404
- except Exception as ex :
405
- if socketdata and socketdata .record :
406
- socketdata .record .exception = ex
407
- raise
383
+ size = method (self , buf , * args , ** kwargs )
408
384
409
385
if socketdata :
410
386
if socketdata .record :
@@ -446,13 +422,7 @@ def hook(self, *args, **kwargs):
446
422
if socketdata :
447
423
logger ().info (f"READ * - socketdata={ socketdata } " )
448
424
449
- try :
450
- r = method (self , * args , ** kwargs )
451
- except Exception as ex :
452
- if not isinstance (ex , ssl .SSLWantReadError ):
453
- if socketdata and socketdata .record :
454
- socketdata .record .exception = ex
455
- raise
425
+ r = method (self , * args , ** kwargs )
456
426
457
427
if socketdata and socketdata .record :
458
428
allargs = getcallargs (method , self , * args , ** kwargs )
0 commit comments