|
37 | 37 | import io.sqreen.powerwaf.RuleSetInfo; |
38 | 38 | import io.sqreen.powerwaf.exception.AbstractPowerwafException; |
39 | 39 | import io.sqreen.powerwaf.exception.InvalidRuleSetException; |
| 40 | +import io.sqreen.powerwaf.exception.TimeoutPowerwafException; |
40 | 41 | import java.io.IOException; |
41 | 42 | import java.lang.reflect.Constructor; |
42 | 43 | import java.lang.reflect.InvocationHandler; |
@@ -410,23 +411,26 @@ public void onDataAvailable( |
410 | 411 | log.debug("Skipped; the WAF is not configured"); |
411 | 412 | return; |
412 | 413 | } |
413 | | - try { |
414 | | - StandardizedLogging.executingWAF(log); |
415 | | - long start = 0L; |
416 | | - if (log.isDebugEnabled()) { |
417 | | - start = System.currentTimeMillis(); |
418 | | - } |
419 | 414 |
|
420 | | - resultWithData = doRunPowerwaf(reqCtx, newData, ctxAndAddr, isTransient); |
| 415 | + StandardizedLogging.executingWAF(log); |
| 416 | + long start = 0L; |
| 417 | + if (log.isDebugEnabled()) { |
| 418 | + start = System.currentTimeMillis(); |
| 419 | + } |
421 | 420 |
|
| 421 | + try { |
| 422 | + resultWithData = doRunPowerwaf(reqCtx, newData, ctxAndAddr, isTransient); |
| 423 | + } catch (TimeoutPowerwafException tpe) { |
| 424 | + log.debug("Timeout calling the WAF", tpe); |
| 425 | + return; |
| 426 | + } catch (AbstractPowerwafException e) { |
| 427 | + log.error("Error calling WAF", e); |
| 428 | + return; |
| 429 | + } finally { |
422 | 430 | if (log.isDebugEnabled()) { |
423 | 431 | long elapsed = System.currentTimeMillis() - start; |
424 | 432 | StandardizedLogging.finishedExecutionWAF(log, elapsed); |
425 | 433 | } |
426 | | - |
427 | | - } catch (AbstractPowerwafException e) { |
428 | | - log.error("Error calling WAF", e); |
429 | | - return; |
430 | 434 | } |
431 | 435 |
|
432 | 436 | StandardizedLogging.inAppWafReturn(log, resultWithData); |
|
0 commit comments