-
Improvement
-
Resolution: Fixed
-
Minor
-
None
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.