Class JaxrsNotFoundException

All Implemented Interfaces:
Serializable

public class JaxrsNotFoundException extends JaxrsException
Exception representing a 404 Not Found that extends JaxrsException to use Kiwi's ErrorMessage.
See Also:
  • Field Details

    • CODE

      public static final int CODE
      The status code for all instances of this exception.
      See Also:
  • Constructor Details

    • JaxrsNotFoundException

      public JaxrsNotFoundException(Throwable cause)
      New instance with given cause and 404 status code.
      Parameters:
      cause - the cause of this exception
    • JaxrsNotFoundException

      public JaxrsNotFoundException(String message)
      New instance with given message and 404 status code.
      Parameters:
      message - the message for this exception
    • JaxrsNotFoundException

      public JaxrsNotFoundException(String message, Throwable cause)
      New instance with given message, cause, and 404 status code.
      Parameters:
      message - the message for this exception
      cause - the cause of this exception
    • JaxrsNotFoundException

      public JaxrsNotFoundException(String type, String itemId)
      New instance with given type and item ID. Resulting message is built using buildMessage(String, Object).
      Parameters:
      type - the type of object that was not found
      itemId - the unique key/identifier of the object that was not found
    • JaxrsNotFoundException

      public JaxrsNotFoundException(String type, Object itemId)
      New instance with given type and item ID. Resulting message is built using buildMessage(String, Object).
      Parameters:
      type - the type of object that was not found
      itemId - the unique key/identifier of the object that was not found
  • Method Details

    • buildMessage

      public static String buildMessage(String type, Object key)
      Build a generic "not found" message using the given type and key.

      Format: [type] [key] was not found.

      Example: User 42 was not found.

      Parameters:
      type - the type of object that was not found
      key - the unique key/identifier of the object that was not found
      Returns:
      the generic "not found" message