Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0.0
-
None
-
None
Description
Issues:
- EL syntax can be validated before starting a component, but data specific exceptions, such as conversion error can not be caught and become runtime exceptions. There will be nothing we can do here, but we should improve error-handling best practice when that happens.
- For data-specific error, some EL functions throw IllegalAttributeException while some others use AttributeExpressionLanguageException, we need to be more consistent
- AttributeExpressionLanguageException and IllegalAttributeException both reside in org.apache.nifi.attribute.expression.language.exception, but don't have common parent Exception. Also, they don't have Javadoc for which one should be used for what errors. Difficult to write a practical error-handling at the caller side
- Above exceptions are RuntimeException and most Processors do not catch such EL evaluation failures. Then causes issues like
NIFI-5761.
Ideas:
- As a non-backward compatible improvement at NiFi 2.0 or later
- Introduce new AttributeExpressionLanguageDataException, which is a checked exception so that caller should handle it properly. (IllegalAttributeException does not sound correct as EL has more broad usage, not only with FlowFile attributes)
- Migrate current AttributeExpressionLanguageException and IllegalAttributeException usages to use AttributeExpressionLanguageDataException properly.
- Add optional 'failure' relationship for each processor at framework-level, so that NiFi can route FlowFiles cause AttributeExpressionLanguageDataException to it.
Attachments
Issue Links
- is related to
-
NIFI-5761 ReplaceText processor can stop processing data if it evaluates invalid expressions
- Resolved