Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5762

Better data-specific Expression Language exception handling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.0
    • None
    • Core Framework
    • None

    Description

      Issues:

      1. 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.
      2. For data-specific error, some EL functions throw IllegalAttributeException while some others use AttributeExpressionLanguageException, we need to be more consistent
      3. 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
      4. Above exceptions are RuntimeException and most Processors do not catch such EL evaluation failures. Then causes issues like NIFI-5761.

      Ideas:

      1. As a non-backward compatible improvement at NiFi 2.0 or later
      2. 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)
      3. Migrate current AttributeExpressionLanguageException and IllegalAttributeException usages to use AttributeExpressionLanguageDataException properly.
      4. Add optional 'failure' relationship for each processor at framework-level, so that NiFi can route FlowFiles cause AttributeExpressionLanguageDataException to it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ijokarumawak Koji Kawamura
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: