From b5671372a8938215489fa5e5c9a7632f9ad0cb6a Mon Sep 17 00:00:00 2001 From: deen13 Date: Wed, 10 Mar 2021 08:32:42 +0100 Subject: [PATCH] Remove detekt --- build.gradle | 1 - src/main/kotlin/de/smartsquare/starter/mqtt/Adapter.kt | 3 ++- .../de/smartsquare/starter/mqtt/BrokerConnectException.kt | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 7557128..62742ca 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,6 @@ plugins { id 'maven-publish' id "org.jetbrains.kotlin.jvm" version "$kotlinVersion" id 'io.spring.dependency-management' version '1.0.11.RELEASE' - id 'io.gitlab.arturbosch.detekt' version "1.15.0" } repositories { diff --git a/src/main/kotlin/de/smartsquare/starter/mqtt/Adapter.kt b/src/main/kotlin/de/smartsquare/starter/mqtt/Adapter.kt index e4a575e..a380b3f 100644 --- a/src/main/kotlin/de/smartsquare/starter/mqtt/Adapter.kt +++ b/src/main/kotlin/de/smartsquare/starter/mqtt/Adapter.kt @@ -7,6 +7,7 @@ import com.hivemq.client.mqtt.mqtt3.message.publish.Mqtt3Publish import org.slf4j.LoggerFactory import org.springframework.beans.factory.InitializingBean import org.springframework.stereotype.Component +import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method @Component @@ -46,7 +47,7 @@ class Adapter( val parameters = subscriber.parameterTypes.map { resolve(it, msg, payloadType) }.toTypedArray() subscriber.invoke(bean, *parameters) - } catch (e: Exception) { + } catch (e: InvocationTargetException) { logger.error("Error while delivering the message.", e) } } diff --git a/src/main/kotlin/de/smartsquare/starter/mqtt/BrokerConnectException.kt b/src/main/kotlin/de/smartsquare/starter/mqtt/BrokerConnectException.kt index e9a5b80..cf1887e 100644 --- a/src/main/kotlin/de/smartsquare/starter/mqtt/BrokerConnectException.kt +++ b/src/main/kotlin/de/smartsquare/starter/mqtt/BrokerConnectException.kt @@ -3,5 +3,7 @@ package de.smartsquare.starter.mqtt import com.hivemq.client.mqtt.mqtt3.message.connect.connack.Mqtt3ConnAck class BrokerConnectException(message: String) : RuntimeException(message) { - constructor(acknowledgement: Mqtt3ConnAck) : this("Unable to connect to broker. Return Code: ${acknowledgement.returnCode.code}") + constructor(acknowledgement: Mqtt3ConnAck) : this( + "Unable to connect to broker. Return Code: ${acknowledgement.returnCode.code}" + ) }