Class ErrorInfo


  • public class ErrorInfo
    extends Object
    Basic error entity.
    Created by The eXo Platform SAS
    Version:
    $Id: ErrorInfo.java 00000 Apr 20, 2015 pnedonosko $
    Author:
    Peter Nedonosko
    • Constructor Detail

      • ErrorInfo

        public ErrorInfo​(String code,
                         String message)
        Instantiates a new error info.
        Parameters:
        code - the code
        message - the message
      • ErrorInfo

        public ErrorInfo​(String message)
        Instantiates a new error info.
        Parameters:
        message - the message
    • Method Detail

      • clientError

        public static ErrorInfo clientError​(String message)
        Client error.
        Parameters:
        message - the message
        Returns:
        the error info
      • notFoundError

        public static ErrorInfo notFoundError​(String message)
        Not found error.
        Parameters:
        message - the message
        Returns:
        the error info
      • accessError

        public static ErrorInfo accessError​(String message)
        Access error.
        Parameters:
        message - the message
        Returns:
        the error info
      • serverError

        public static ErrorInfo serverError​(String message)
        Server error.
        Parameters:
        message - the message
        Returns:
        the error info
      • getCode

        public String getCode()
        Gets the code.
        Returns:
        the code
      • getMessage

        public String getMessage()
        Gets the message.
        Returns:
        the message
      • asJSON

        public String asJSON()
        Error as JSON string.
        Returns:
        the string