public abstract class FormFillFailure extends IOException implements org.kohsuke.stapler.HttpResponse
Use one of the factory methods to create an instance, then throw it from your doFillXyz
method.
Modifier and Type | Method and Description |
---|---|
static FormFillFailure |
error(String message)
Sends out a string error message that indicates an error.
|
static FormFillFailure |
error(String format,
Object... args)
Sends out a string error message that indicates an error,
by formatting it with
String.format(String, Object[]) |
static FormFillFailure |
error(Throwable e,
String message)
Sends out a string error message, with optional "show details" link that expands to the full stack trace.
|
static FormFillFailure |
error(Throwable e,
String format,
Object... args) |
static FormFillFailure |
errorWithMarkup(String message)
Sends out an HTML fragment that indicates an error.
|
void |
generateResponse(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
Object node) |
FormValidation.Kind |
getKind() |
boolean |
isSelectionCleared() |
abstract String |
renderHtml() |
static FormFillFailure |
respond(FormValidation.Kind kind,
String html)
Sends out an arbitrary HTML fragment as the output.
|
static FormFillFailure |
warning(String message) |
static FormFillFailure |
warning(String format,
Object... args) |
static FormFillFailure |
warning(Throwable e,
String message) |
static FormFillFailure |
warning(Throwable e,
String format,
Object... args) |
static FormFillFailure |
warningWithMarkup(String message) |
FormFillFailure |
withSelectionCleared()
Flags this failure as requiring that the select options should be cleared out.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static FormFillFailure error(@NonNull String message)
message
- Human readable message to be sent.public static FormFillFailure warning(@NonNull String message)
public static FormFillFailure error(String format, Object... args)
String.format(String, Object[])
public static FormFillFailure warning(String format, Object... args)
public static FormFillFailure error(Throwable e, String message)
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.
public static FormFillFailure warning(Throwable e, String message)
public static FormFillFailure error(Throwable e, String format, Object... args)
public static FormFillFailure warning(Throwable e, String format, Object... args)
public static FormFillFailure errorWithMarkup(String message)
This method must be used with care to avoid cross-site scripting attack.
message
- Human readable message to be sent. error(null)
can be used as ok()
.public static FormFillFailure warningWithMarkup(String message)
public static FormFillFailure respond(FormValidation.Kind kind, String html)
public void generateResponse(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Object node) throws IOException, javax.servlet.ServletException
generateResponse
in interface org.kohsuke.stapler.HttpResponse
IOException
javax.servlet.ServletException
public FormValidation.Kind getKind()
public boolean isSelectionCleared()
public FormFillFailure withSelectionCleared()
this
for method chaining.public abstract String renderHtml()
Copyright © 2004–2022. All rights reserved.