Skip to content
Snippets Groups Projects
Commit eb63b0c8 authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch '247-make-exception-handling-understandable' into 'master'

make excpetion handling understandable

Closes #247

See merge request !179
parents 122c2521 746d87df
No related branches found
No related tags found
1 merge request!179make excpetion handling understandable
Pipeline #4679 passed
......@@ -32,7 +32,7 @@ class PatcherFactory {
k8sResources.filter { it.first == patcherDefinition.resource }
.map { resource -> resource.second }
.firstOrNull()
?: throw DeploymentFailedException("Could not find resource ${patcherDefinition.resource}")
?: throw InvalidPatcherConfigurationException("Could not find resource ${patcherDefinition.resource}")
return try {
when (patcherDefinition.type) {
......@@ -86,10 +86,10 @@ class PatcherFactory {
)
else -> throw InvalidPatcherConfigurationException("Patcher type ${patcherDefinition.type} not found.")
}
} catch (e: Exception) {
} catch (e: NullPointerException) {
throw InvalidPatcherConfigurationException(
"Could not create patcher with type ${patcherDefinition.type}" +
" Probably a required patcher argument was not specified."
" Probably a required patcher argument was not specified.", e
)
}
}
......
package theodolite.util
class InvalidPatcherConfigurationException(message: String) : Exception(message)
class InvalidPatcherConfigurationException(message: String, e: Exception? = null) : Exception(message, e)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment