Class AthException

  • All Implemented Interfaces:
    Serializable

    public class AthException
    extends Exception
    Base exception class for all ATH (AcumenTranslation Hub) framework exceptions. This class provides structured exception handling with integrated logging capabilities. All custom exceptions in the ATH framework should extend this class.

    Key Features:

    • Integrated logging with exception throwing
    • Message formatting using SLF4J pattern
    • Support for exception chaining
    • Thread-safe exception creation
    Since:
    1.0
    Version:
    1.0
    Author:
    Acumen Velocity
    See Also:
    Serialized Form
    • Method Detail

      • logAndThrow

        public static void logAndThrow​(Class<?> loggingClass,
                                       String format,
                                       Object... arguments)
                                throws AthException
        Logs an error message and throws an AthException.

        This method provides a consistent pattern for error handling by combining logging and exception throwing in a single operation.

        Parameters:
        loggingClass - the class where the error occurred (for logging context)
        format - the error message format string with {} placeholders
        arguments - the arguments to substitute into the format string
        Throws:
        AthException - always throws an AthException after logging
      • logAndThrow

        public static void logAndThrow​(Class<?> loggingClass,
                                       Throwable cause,
                                       String format,
                                       Object... arguments)
                                throws AthException
        Logs an error message with cause and throws an AthException.
        Parameters:
        loggingClass - the class where the error occurred (for logging context)
        cause - the underlying exception that caused this error
        format - the error message format string with {} placeholders
        arguments - the arguments to substitute into the format string
        Throws:
        AthException - always throws an AthException after logging
      • logAndThrow

        public static void logAndThrow​(Class<?> loggingClass,
                                       Throwable cause)
                                throws AthException
        Logs an error with just the cause and throws an AthException.
        Parameters:
        loggingClass - the class where the error occurred (for logging context)
        cause - the underlying exception that caused this error
        Throws:
        AthException - always throws an AthException after logging