Skip to content
Snippets Groups Projects
Commit 746d87df authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Sören Henning
Browse files

make excpetion handling understandable

parent 122c2521
No related branches found
No related tags found
1 merge request!179make excpetion handling understandable
......@@ -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