diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/NvtxWithMetrics.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/NvtxWithMetrics.scala index 27b3beb3ba6..1ff3e0b0b84 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/NvtxWithMetrics.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/NvtxWithMetrics.scala @@ -58,7 +58,7 @@ object ThreadLocalMetrics { def onMetricsExit(gpuMetric: GpuMetric): Unit = { if (gpuMetric != NoopMetric) { if (!ThreadLocalMetrics.currentThreadMetrics.get().contains(gpuMetric)) { - throw new IllegalStateException()("Metric missing from thread local storage: " + throw new IllegalStateException("Metric missing from thread local storage: " + gpuMetric) } ThreadLocalMetrics.currentThreadMetrics.get().remove(gpuMetric)