Class UltiToolsException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ultikits.ultitools.exceptions.UltiToolsException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CommandException, ConfigurationException, ContainerException, DataAccessException, PluginModuleException

public abstract class UltiToolsException extends RuntimeException
Base exception class for all UltiTools exceptions.

All custom exceptions in UltiTools should extend this class to provide consistent error handling with error codes.

Since:
6.2.0
Author:
wisdomme
See Also:
  • Field Details

    • errorCode

      private final ErrorCode errorCode
  • Constructor Details

    • UltiToolsException

      protected UltiToolsException(ErrorCode errorCode)
      Creates a new exception with the given error code.
      Parameters:
      errorCode - the error code
    • UltiToolsException

      protected UltiToolsException(ErrorCode errorCode, String message)
      Creates a new exception with the given error code and custom message.
      Parameters:
      errorCode - the error code
      message - the custom error message
    • UltiToolsException

      protected UltiToolsException(ErrorCode errorCode, String message, Throwable cause)
      Creates a new exception with the given error code, message, and cause.
      Parameters:
      errorCode - the error code
      message - the custom error message
      cause - the underlying cause
    • UltiToolsException

      protected UltiToolsException(ErrorCode errorCode, Throwable cause)
      Creates a new exception with the given error code and cause.
      Parameters:
      errorCode - the error code
      cause - the underlying cause
  • Method Details

    • getErrorCode

      public ErrorCode getErrorCode()
      Gets the error code associated with this exception.
      Returns:
      the error code
    • getFormattedMessage

      public String getFormattedMessage()
      Gets the formatted error message including the error code.
      Returns:
      the formatted message
    • toString

      public String toString()
      Overrides:
      toString in class Throwable