aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt
diff options
context:
space:
mode:
Diffstat (limited to 'hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt')
-rw-r--r--hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt
index 5f6a86ad..083d5798 100644
--- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt
+++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/WrongArgumentException.kt
@@ -23,7 +23,14 @@ import org.apache.commons.cli.HelpFormatter
import org.apache.commons.cli.Options
-class WrongArgumentException(parent: Exception, private val options: Options) : Exception(parent.message, parent) {
+class WrongArgumentException(
+ message: String,
+ private val options: Options,
+ parent: Throwable? = null
+) : Exception(message, parent) {
+
+ constructor(par: Throwable, options: Options) : this(par.message ?: "", options, par)
+
fun printMessage() {
println(message)
}