Add recovery during deserialization and upload test artifacts (#243)
* Add recovery during message deserialization, update workflow, use JUnit Platform for JVM tests
This commit is contained in:
parent
b37a0f62d0
commit
a23856e68e
1 changed files with 28 additions and 4 deletions
|
|
@ -44,7 +44,17 @@ public class ReadBuffer {
|
|||
try {
|
||||
return deserializeMessage(line)
|
||||
} catch (e: Exception) {
|
||||
logger.error(e) { "Failed to deserialize message from line: $line\nSkipping..." }
|
||||
logger.error(e) { "Failed to deserialize message from line: $line\nAttempting to recover..." }
|
||||
// if there is a non-JSON object prefix, try to parse from the first '{' onward.
|
||||
val braceIndex = line.indexOf('{')
|
||||
if (braceIndex != -1) {
|
||||
val trimmed = line.substring(braceIndex)
|
||||
try {
|
||||
return deserializeMessage(trimmed)
|
||||
} catch (ignored: Exception) {
|
||||
logger.error(ignored) { "Deserialization failed for line: $line\nSkipping..." }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
|
|
|
|||
Loading…
Reference in a new issue