Skip to content

Commit

Permalink
Formatters can not fail when formatting an event
Browse files Browse the repository at this point in the history
In the case of a malformed event, multiple recovery strategies are attempted
and an error message is added to the formatted message.
  • Loading branch information
vruello committed Oct 20, 2023
1 parent 2c25309 commit 46aac17
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 67 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Clear in-memory subscriptions when a SIGHUP signal is received, resulting in all file descriptors used by subscriptions being closed (#37)
- `heartbeats_queue_size` now defaults to 2048 instead of 32 (#37)
- **Breaking change**: Keytab file path must be specified only once for all collectors (using Kerberos authentication)
- A malformed event will no longer stop the event stream (for a computer/subscription) because formatters are not allowed to fail. In problematic cases, some work is done to try to recover the raw data of the event, and an `OpenWEC.Error` field is added (in the JSON formatter) to help catch the problem (#47)

## [0.1.0] - 2023-05-30

Expand Down
6 changes: 6 additions & 0 deletions doc/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ openwec_data := {
"Version": string,
"Uuid": string,
"Uri": string
},
/* Only in case of error during event parsing or serializing */
"Error": {
"OriginalContent": string,
"Type": string,
"Message": string
}
}

Expand Down
Loading

0 comments on commit 46aac17

Please sign in to comment.