diff options
Diffstat (limited to 'sources/hv-collector-utils/src/main/kotlin')
2 files changed, 10 insertions, 6 deletions
diff --git a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/arrow/core.kt b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/arrow/core.kt index cb1c6222..bedc2fcd 100644 --- a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/arrow/core.kt +++ b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/arrow/core.kt @@ -52,4 +52,8 @@ fun <A, B> Either<A, B>.doOnLeft(action: () -> Unit): Either<A, B> = apply { if fun <A> Option<A>.doOnEmpty(action: () -> Unit): Option<A> = apply { if (isEmpty()) action() } -fun <A> Try<A>.doOnFailure(action: () -> Unit): Try<A> = apply { if (isFailure()) action() } +fun <A> Try<A>.doOnFailure(action: (Throwable) -> Unit): Try<A> = apply { + if (this is Try.Failure) { + action(exception) + } +} diff --git a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt index e869901d..aaa8ff83 100644 --- a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt +++ b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt @@ -106,11 +106,11 @@ enum class CommandLineOption(val option: Option, val required: Boolean = false) .build() ), KEY_STORE_PASSWORD( - Option.builder("kp") - .longOpt("key-store-password") - .hasArg() - .desc("Key store password") - .build() + Option.builder("kp") + .longOpt("key-store-password") + .hasArg() + .desc("Key store password") + .build() ), TRUST_STORE_FILE( Option.builder("t") |