Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Implement "strict" mode. #192

Closed
blackwinter opened this issue Mar 3, 2022 · 2 comments · Fixed by #210
Closed

Implement "strict" mode. #192

blackwinter opened this issue Mar 3, 2022 · 2 comments · Fixed by #210
Assignees

Comments

@blackwinter
Copy link
Member

Catmandu usually (silently) ignores unexpected values/data types, while Metafix currently throws exceptions (java.lang.IllegalStateException). It might make sense to support both modes:

  • strict (current default): Throw exception.
  • non-strict (future default): Ignore; optionally log a warning.

Probably requires some kind of configuration mechanism (see metafacture/metafacture-core#597).

@blackwinter
Copy link
Member Author

A workaround may be achieved with org.metafacture.flowcontrol.ObjectExceptionCatcher (catch-object-exception).

blackwinter added a commit that referenced this issue Mar 30, 2022
Levels of strictness:

- `PROCESS`: Abort process by throwing an exception.
- `RECORD`: Ignore (skip) record and log an error.
- `EXPRESSION`: Ignore (skip) expression and log a warning.

Introduces `FixProcessException` to differentiate from `FixExecutionException`: The latter indicating potentially data-dependent issues that should be subject to strictness handling, while the former should only refer to static issues with the usage of Fix expressions.
@blackwinter
Copy link
Member Author

Functional review: @TobiasNx
Code review: @fsteeg

@blackwinter blackwinter moved this to Review in Metafacture Mar 30, 2022
Repository owner moved this from Review to Done in Metafacture Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants