Am 23.12.20 um 19:16 schrieb Tong Sun:
> Hi,
>
> Most people would have some Java code to support JMeter test scripts.
> How to print stack trace for the Java code when something went wrong?
>
> I tried:
>
> try {
> // some code
> } catch(Error e) {
> log.error("Error: $e")
> log.info("${org.codehaus.groovy.runtime.StackTraceUtils.sanitize(new
> Exception(e)).printStackTrace()}")
> }
>
> base on
> https://stackoverflow.com/questions/6259202/how-do-i-print-a-groovy-stack-trace
> and also `e.printStackTrace()` from Java, but both print out just "null"
Where would you place those code? If you use that inside of JMeter
JSR-223 scripts, you will get bitten by JMeter replacing the ${...} stuff.
Felix
>
> pls help. thx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]