Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20325

Make the default/error text for the 'FILE' token configurable

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The FILE token does not allow to configure the text that occurs when the file does not exist. It'd be great if this were configurable for cases when this is a non-exceptional occurrence.

      Example:

      ${FILE, path="logs/warnings.html", filenotfoundmessage="No warnings were recorded in %f"}

      The current (2.35.1) error message would be implemented using this new parameter as follows:

      ${FILE, path="logs/warnings.html", filenotfoundmessage="ERROR: File '%f' does not exist"}

      This assumes there aren't any more error cases than just 'file not found'. Not sure if there are others. Alternatively, make it possible to mark a $FILE token as e.g. optional=true (so errors are discarded), and to provide a 'default text' like in JENKINS-20324.

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          The only other error case is if the file can't be read.

          Show
          slide_o_mix Alex Earl added a comment - The only other error case is if the file can't be read.
          Hide
          slide_o_mix Alex Earl added a comment -

          Added fileNotFoundMessage parameter to the FILE token. The %s in the message will be replaced with the file name. The parameter is optional and if it is not given, the current string will be returned.

          Show
          slide_o_mix Alex Earl added a comment - Added fileNotFoundMessage parameter to the FILE token. The %s in the message will be replaced with the file name. The parameter is optional and if it is not given, the current string will be returned.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: slide
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContent.java
          src/test/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContentTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/178360e1e5de258710609aefea7ed9e15fcfcd89
          Log:
          Fix JENKINS-20325

          Added fileNotFoundMessage paramter. The %s in the message will be replaced
          with the filename.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: slide Path: src/main/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContent.java src/test/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContentTest.java http://jenkins-ci.org/commit/email-ext-plugin/178360e1e5de258710609aefea7ed9e15fcfcd89 Log: Fix JENKINS-20325 Added fileNotFoundMessage paramter. The %s in the message will be replaced with the filename.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              danielbeck Daniel Beck
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: