mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-20 01:36:50 +00:00
Handle not parsable data quality reports
This commit is contained in:
parent
70d4fa2f0f
commit
7f8b21efd2
@ -20,6 +20,7 @@
|
|||||||
package dev.dnpm.etl.processor.monitoring
|
package dev.dnpm.etl.processor.monitoring
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue
|
import com.fasterxml.jackson.annotation.JsonValue
|
||||||
|
import com.fasterxml.jackson.core.JsonParseException
|
||||||
import com.fasterxml.jackson.databind.JsonMappingException
|
import com.fasterxml.jackson.databind.JsonMappingException
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper
|
import com.fasterxml.jackson.databind.ObjectMapper
|
||||||
|
|
||||||
@ -33,9 +34,14 @@ class ReportService(
|
|||||||
}
|
}
|
||||||
return try {
|
return try {
|
||||||
objectMapper.readValue(dataQualityReport, DataQualityReport::class.java).issues
|
objectMapper.readValue(dataQualityReport, DataQualityReport::class.java).issues
|
||||||
} catch (e: JsonMappingException) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
val otherIssue =
|
||||||
listOf()
|
Issue(Severity.ERROR, "Not parsable data quality report '$dataQualityReport'")
|
||||||
|
return when (e) {
|
||||||
|
is JsonMappingException -> listOf(otherIssue)
|
||||||
|
is JsonParseException -> listOf(otherIssue)
|
||||||
|
else -> throw e
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user