-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: core
If a hudson.model.Descriptor.FormException is thrown then the resulting error shown to the user does not include the filed that caused the error.
Â
this leads to either having to duplicate the field name in the message, or a page that is mostly useless to the user as they do not know which field the error refers to.
Â
Because of this it is preferable to throw a different unchecked exception even though this is the expected exception for form binding errors, so that the details are at least present in the logs
Â
reproduction steps
in a @DataboundConstructor throw a new FormException("can not be null", "theField")
Attempt to create a new instance of the describable
Expected Results
the page displayed to the user contains the error message "can not be null" as well as a reference to the field `theField`
Actual results
only the message is show
this is because the code ignores the field here
This is also worse since https://github.com/jenkinsci/jenkins/pull/9495 as the exception no longer triggers an angry Jenkins and prints the line in the logs to correlate.