Class AthException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.acumenvelocity.ath.common.exception.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidlogAndThrow(Class<?> loggingClass, String format, Object... arguments)Logs an error message and throws an AthException.static voidlogAndThrow(Class<?> loggingClass, Throwable cause)Logs an error with just the cause and throws an AthException.static voidlogAndThrow(Class<?> loggingClass, Throwable cause, String format, Object... arguments)Logs an error message with cause and throws an AthException.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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 {} placeholdersarguments- 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 errorformat- the error message format string with {} placeholdersarguments- 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
-
-