Commit 7538acac authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Rethrow invalid mapping exception in local transform.

Rename log messages in local transform loader to use local instead of global.
parent b06ff221
Pipeline #16095 failed with stage
in 2 minutes and 6 seconds
......@@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager
import org.memobase.exceptions.InvalidMappingException
class LocalTransformsLoader(data: ByteArray) {
private val log = LogManager.getLogger("GlobalTransformLoader")
private val log = LogManager.getLogger("LocalTransformsLoader")
private val objectMapper = ObjectMapper(YAMLFactory()).registerKotlinModule()
private val transforms: LocalTransform
......@@ -22,10 +22,13 @@ class LocalTransformsLoader(data: ByteArray) {
objectMapper.readValue(ByteArrayInputStream(data), LocalTransform::class.java)
} catch (ex: MismatchedInputException) {
log.error("The local transform file could not be parsed: ${ex.localizedMessage}.")
throw InvalidMappingException("The global transform file could not be parsed: ${ex.localizedMessage}.")
throw InvalidMappingException("The local transform file could not be parsed: ${ex.localizedMessage}.")
} catch (ex: InvalidMappingException) {
log.error(ex.localizedMessage)
throw InvalidMappingException(ex.localizedMessage)
} catch (ex: Exception) {
log.error("Unknown exception while parsing local transform: ${ex.localizedMessage}.")
throw InvalidMappingException("Unknown exception while parsing global transform: ${ex.localizedMessage}.")
throw InvalidMappingException("Unknown exception while parsing local transform: ${ex.localizedMessage}.")
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment