stephenconnolly, could you please suggest on the following?
in doFillXyzItems() method if we throw an exception (other than FormValidation) there will be stack trace shown to the user under select entry field.
If we throw FormValidation exception in doFillXyzItems(), there will be some java script error so expected behavior for such case is unknown for me.
Was there any intent to handle FormValidation exception differently than other ones? Does it make sense to request such functionality?
Example:
field A (select entry)
field B (select entry)
B select items will be filled based on A.
The question is how to handle doFillBItems() when A validation failed and do not scare user by stack trace but show some meaningful information. At this point of time I do not know how to catch in doFillBItems() information about failed validation of A field, so I just use A and there can be exception (which will be good to handle somehow).
Definitely I can make extra logic and return old value which was stored for B (checked that it is possible). But also it could be nice to have Jenkins it handle for us and show just FormValidation error instead of stack trace and preserve values what were stored before (as it works now).
And actually the it can be super nice to have information about validation of field on which we are depending in doFillBItems() or even do not trigger doFillBItems() if A validation failed.
Code changed in jenkins
User: Stephen Connolly
Path:
core/src/main/java/hudson/util/FormFillFailure.java
core/src/main/resources/lib/form/select/select.js
http://jenkins-ci.org/commit/jenkins/ed329d1088c164df560b9299cd9096ae76519418
Log:
[FIXED JENKINS-42443] Make f:select display spinner during AJAX requests