Package hudson.util
Class FormFillFailure
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
hudson.util.FormFillFailure
- All Implemented Interfaces:
Serializable
,org.kohsuke.stapler.HttpResponse
public abstract class FormFillFailure
extends IOException
implements org.kohsuke.stapler.HttpResponse
Represents a failure in a form field doFillXYZ method.
Use one of the factory methods to create an instance, then throw it from your doFillXyz
method.
- Since:
- 2.50
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic FormFillFailure
Sends out a string error message that indicates an error.static FormFillFailure
Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])
static FormFillFailure
Sends out a string error message, with optional "show details" link that expands to the full stack trace.static FormFillFailure
static FormFillFailure
errorWithMarkup
(String message) Sends out an HTML fragment that indicates an error.void
generateResponse
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) getKind()
boolean
abstract String
static FormFillFailure
respond
(FormValidation.Kind kind, String html) Sends out an arbitrary HTML fragment as the output.static FormFillFailure
static FormFillFailure
static FormFillFailure
static FormFillFailure
static FormFillFailure
warningWithMarkup
(String message) Flags this failure as requiring that the select options should be cleared out.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.kohsuke.stapler.HttpResponse
generateResponse
-
Method Details
-
error
Sends out a string error message that indicates an error.- Parameters:
message
- Human readable message to be sent.
-
warning
-
error
Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])
-
warning
-
error
Sends out a string error message, with optional "show details" link that expands to the full stack trace.Use this with caution, so that anonymous users do not gain too much insights into the state of the system, as error stack trace often reveals a lot of information. Consider if an error needs to be exposed to everyone or just those who have higher access to job/hudson/etc.
-
warning
-
error
-
warning
-
errorWithMarkup
Sends out an HTML fragment that indicates an error.This method must be used with care to avoid cross-site scripting attack.
- Parameters:
message
- Human readable message to be sent.error(null)
can be used asok()
.
-
warningWithMarkup
-
respond
Sends out an arbitrary HTML fragment as the output. -
generateResponse
public void generateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) throws IOException, jakarta.servlet.ServletException - Specified by:
generateResponse
in interfaceorg.kohsuke.stapler.HttpResponse
- Throws:
IOException
jakarta.servlet.ServletException
-
getKind
-
isSelectionCleared
public boolean isSelectionCleared() -
withSelectionCleared
Flags this failure as requiring that the select options should be cleared out.- Returns:
this
for method chaining.
-
renderHtml
-