Package com.exasol.errorreporting
Class ErrorMessageBuilder
- java.lang.Object
-
- com.exasol.errorreporting.ErrorMessageBuilder
-
public class ErrorMessageBuilder extends Object
Builder for Exasol error messages.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ErrorMessageBuildermessage(String message, Object... arguments)Define an error message.ErrorMessageBuildermitigation(String mitigation, Object... arguments)Add a mitigation.ErrorMessageBuilderparameter(String name, Object value)Add a parameter.ErrorMessageBuilderparameter(String placeholder, Object value, String ignoredDescription)Add a parameter.ErrorMessageBuilderticketMitigation()Add a mitigation for cases in which the only thing a user can do is opening a ticket.StringtoString()Build the error message.
-
-
-
Method Detail
-
message
public ErrorMessageBuilder message(String message, Object... arguments)
Define an error message.Error messages can optionally contain placeholders that can be replaced by arguments.
- Parameters:
message- message that may contain placeholdersarguments- arguments to fill the placeholders- Returns:
- self for fluent programming
-
parameter
public ErrorMessageBuilder parameter(String name, Object value)
Add a parameter. This method quotes the parameter.You can use the parameter in message and mitigation using
{{parameter}}.- Parameters:
name- parameter namevalue- value to insert- Returns:
- self for fluent programming
-
parameter
public ErrorMessageBuilder parameter(String placeholder, Object value, String ignoredDescription)
Add a parameter.You can use the parameter in message and mitigation using
{{parameter}}.Note that the last parameter exists only as a means to add a description in the error catalog. It is not used when displaying error messages to the application users.
- Parameters:
placeholder- placeholder without parenthesesvalue- value to insertignoredDescription- description for the error catalog- Returns:
- self for fluent programming
-
mitigation
public ErrorMessageBuilder mitigation(String mitigation, Object... arguments)
Add a mitigation. Explain here what users can do to resolve or avoid this error.For learning about the format rules, see
message(String, Object...).- Parameters:
mitigation- mitigation message that may contain placeholdersarguments- arguments to fill the placeholders- Returns:
- self for fluent programming
-
ticketMitigation
public ErrorMessageBuilder ticketMitigation()
Add a mitigation for cases in which the only thing a user can do is opening a ticket.- Returns:
- self for fluent programming
-
-