From 37a2ee9a97270d7d655db262dd16240df4c23c20 Mon Sep 17 00:00:00 2001
From: JustAnotherChristoph
 <47302982+JustAnotherChristoph@users.noreply.github.com>
Date: Fri, 13 May 2022 12:30:15 +0200
Subject: [PATCH] using the already existing logger instead of an exception to
 inform about calling the method on non-handled executionstates

---
 .../theodolite/kubernetes/operator/ExecutionEventHandler.kt  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/operator/ExecutionEventHandler.kt b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/operator/ExecutionEventHandler.kt
index 8aab8b4bb..e4e12b1e0 100644
--- a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/operator/ExecutionEventHandler.kt
+++ b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/operator/ExecutionEventHandler.kt
@@ -42,8 +42,9 @@ class ExecutionEventHandler(
                     this.controller.stop(restart = true)
                 }
             }
-            // TODO: Why does this not trigger additional warnings for uncatched exception?
-            else -> throw IllegalStateException("onAdd does not handle the current execution state ($currentState)")
+            else -> {
+                logger.info { "ExecutionEventHandler#onAdd(...) does not handle ExecutionState $currentState" }
+            }
         }
     }
 
-- 
GitLab