diff --git a/orx-osc/src/main/kotlin/OSC.kt b/orx-osc/src/main/kotlin/OSC.kt index 7beeaa7b..6dd393de 100644 --- a/orx-osc/src/main/kotlin/OSC.kt +++ b/orx-osc/src/main/kotlin/OSC.kt @@ -30,11 +30,10 @@ class OSC ( try { sender.send(msg) - } catch (ex: Exception) { - when(ex) { - is PortUnreachableException -> logger.error(ex) { "Error: Could not connect to OUT port" } - is IllegalStateException -> logger.error(ex) { "Error: Couldn't send message to channel: $channel" } - } + } catch (ex: PortUnreachableException) { + logger.error(ex) { "Error: Could not connect to OUT port" } + } catch (ex: IllegalStateException) { + logger.error(ex) { "Error: Couldn't send message to channel: $channel" } } }