Class PubServerException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.priint.pubserver.exception.PubServerException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthManagerException, CometException, ConfigManagerCheckinException, ConfigManagerCheckoutException, ConfigManagerDeleteException, ConfigManagerException, ConfigManagerFileIsAlreadyLocked, ConfigManagerMergeException, ConfigManagerValidateException, ConnectorException, DataProviderException, DataSourceException, DeploymentManagerException, DocumentLockManagerException, DocumentManagerException, EntityManagerException, ErrorCodeNotFoundException, ExecutionException, FileIOException, InvalidArgumentException, InvalidResultTypeException, InvalidSessionException, MediaAssetManagerException, NotDeployedException, NotImplementedException, ParameterInterpreterException, PluginException, PubServerRolledbackException, ResourceNotFoundException, ServerException, ServerException, ServiceException, SessionManagerException, SessionNotAuthenticated, TableUtils.TableUtilsException, ValidationFailedException, XMLException

public abstract class PubServerException extends Exception implements Serializable
Abstract base exception for all public exceptions in publishing server.

This is a checked exception (Application Exception). It does NOT force a transaction rollback of the EJB container.

If you DO want to force a rollback of the current transaction use the PubServerRolledbackException instead.

Since:
4.0.0
See Also:
  • Constructor Details

    • PubServerException

      public PubServerException()
    • PubServerException

      public PubServerException(Object caller, int errorCode, String message, Throwable cause, String... parameters)
      Create a basic publishing server exception.
      Parameters:
      message - short textual error message, possibly containing some identifying object data
      cause - (optional) original exception leading to this one or null
      errorCode - some error specific code for support or 0. Error codes should be defined as public constants in the exception class derived from PubServerException.
      caller - Object that creates this exception. Object class name will be used as name of the module that created this exception. If caller is of type String the string itself will be used as module name (long strings might be truncated).
      parameters - the parameters
    • PubServerException

      public PubServerException(String message, Throwable cause, int errorCode, Object caller)
      Instantiates a new Pub server exception with no parameters.
      Parameters:
      message - the message
      cause - the cause
      errorCode - the error code
      caller - the caller
    • PubServerException

      public PubServerException(String message, Throwable cause, int errorCode, Object caller, String... parameters)
      Instantiates a new Pub server exception.
      Parameters:
      message - the message
      cause - the cause
      errorCode - the error code
      caller - the caller
      parameters - the parameters
  • Method Details

    • getCode

      public final int getCode()
      Get error code. Error codes should be defined as public constants in the exception class derived from PubServerException.
      Returns:
      code as integer.
    • getModule

      public final String getModule()
      Get module name that created this exception. Name will be derived from caller argument of the exception constructor.
      Returns:
      module name
    • getFormattedMessage

      public final String getFormattedMessage()
      Returns a formatted exception message for the exception. Like:
       MyPlugin:00201  Third Exception [hashCode=452800031]
       
      Returns:
      formatted exception message
    • getFormattedMessageTrace

      public final String getFormattedMessageTrace()
      Returns a formatted exception message for the exception and all causes. Like:
       [1] MyPlugin1:00201  Third Exception [hashCode=452800031]
       [2] Exception:00000 <java.lang.Exception> Second Exception
       [3] MyPlugin2:00200  First Exception [hashCode=452800031]
       
      Returns:
      formatted exception message
    • getMessageStack

      public final List<String> getMessageStack()
      Returns a List of Exception Messages following the cause chain to the initial exception and message from current exception
      Returns:
      message list
    • getExceptionsStack

      public List<Throwable> getExceptionsStack(Throwable exception)
      Returns list of exceptions from exceptions stack
      Parameters:
      exception - from which we want to get stack of exceptions
      Returns:
      list of Throwable objects
    • getErrorsStack

      public List<ErrorStackInfo> getErrorsStack()
      This method returns list of ErrorStackInfo, the list is not filled automatically. To fill this list you need to call setErrorsStack() method manually.
      Returns:
    • retrieveErrorsStack

      public void retrieveErrorsStack()
      Sets errorsStack list
    • getErrorCodeInfo

      public ErrorCodeInfo getErrorCodeInfo()
      This methods returns ErrorCodeInfo object. This object is not filled automatically. To set this object you must call setErrorCodeInfo();
      Returns:
    • retrieveErrorCodeInfo

      public void retrieveErrorCodeInfo()
      Sets errorCodeInfo object
    • getParameters

      public String[] getParameters()
      Get parameters string [ ] array.
      Returns:
      the string [ ]