Class ErrorMessageBuilder


  • public class ErrorMessageBuilder
    extends Object
    Builder for Exasol error messages.
    • 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 placeholders
        arguments - 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 name
        value - 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 parentheses
        value - value to insert
        ignoredDescription - 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 placeholders
        arguments - 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
      • toString

        public String toString()
        Build the error message.
        Overrides:
        toString in class Object
        Returns:
        built error massage string