[ 
https://issues.apache.org/jira/browse/NIFI-5843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701998#comment-16701998
 ] 

ASF GitHub Bot commented on NIFI-5843:
--------------------------------------

GitHub user SavtechSolutions opened a pull request:

    https://github.com/apache/nifi/pull/3186

    NIFI-5843 added subjects to the error message to make it clearer

    Fix for the 
[https://issues.apache.org/jira/projects/NIFI/issues/NIFI-5843](NIFI-5843)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/SavtechSolutions/nifi nifi-5843

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/3186.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3186
    
----
commit fbdc2a1ac94d2b3ba02ef667993f78be16500e12
Author: Alex Savitsky <alex.savitsky@...>
Date:   2018-11-28T15:10:08Z

    NIFI-5843 added subjects to the error message when neither script body nor 
script text are provided

----


> Unclear validation message for ScriptingComponentHelper
> -------------------------------------------------------
>
>                 Key: NIFI-5843
>                 URL: https://issues.apache.org/jira/browse/NIFI-5843
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>    Affects Versions: 1.8.0
>            Reporter: Alex Savitsky
>            Priority: Trivial
>
> ScriptingComponentHelper.customValidate (from nifi-scripting-processors) 
> creates an unclear validation message
> {quote}'' is invalid because Exactly one of Script File or Script Body must 
> be set
> {quote}
> as it doesn't specify the validation subject. Since there are technically two 
> invalid subjects in this case (Script File and Script Body), I suggest adding 
> two validation messages, one for each subject.
> Current code:
> {code:java}
> results.add(new ValidationResult.Builder().valid(false).explanation(
>         "Exactly one of Script File or Script Body must be set").build());
> {code}
> Proposed fix:
> {code:java}
> results.add(new ValidationResult.Builder().subject("Script 
> Body").valid(false).explanation(
>         "exactly one of Script File or Script Body must be set").build());
> results.add(new ValidationResult.Builder().subject("Script 
> File").valid(false).explanation(
>         "exactly one of Script File or Script Body must be set").build());
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to