Class AthRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.acumenvelocity.ath.common.exception.AthRuntimeException
-
- All Implemented Interfaces:
Serializable
public class AthRuntimeException extends RuntimeException
Runtime exception variant ofAthExceptionfor unchecked exceptions in the ATH framework.This class should be used for exceptions that don't need to be declared in method signatures but still require the same structured handling and logging as checked exceptions.
Usage Guidelines:
- Use for programming errors that shouldn't be caught
- Use for exceptions that indicate system configuration issues
- Use when exception handling would clutter the code unnecessarily
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Acumen Velocity
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AthRuntimeException(String format, Object... args)Creates a new AthRuntimeException with a formatted message.AthRuntimeException(Throwable cause)Creates a new AthRuntimeException with a given parent exception cause.AthRuntimeException(Throwable cause, String message)Creates a new AthRuntimeException with a given message and parent exception cause.AthRuntimeException(Throwable cause, String format, Object... args)Creates a new AthRuntimeException with a formatted message and cause.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidlogAndThrow(Class<?> loggingClass, String format, Object... args)Logs an error message and throws an AthRuntimeException.static voidlogAndThrow(Class<?> loggingClass, Throwable cause)Logs an error with just the cause and throws an AthRuntimeException.static voidlogAndThrow(Class<?> loggingClass, Throwable cause, String format, Object... args)Logs an error message with cause and throws an AthRuntimeException.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AthRuntimeException
public AthRuntimeException(String format, Object... args)
Creates a new AthRuntimeException with a formatted message.- Parameters:
format- the message format string with {} placeholdersargs- the arguments to substitute into the format string
-
AthRuntimeException
public AthRuntimeException(Throwable cause)
Creates a new AthRuntimeException with a given parent exception cause.- Parameters:
cause- the underlying exception that caused this exception
-
AthRuntimeException
public AthRuntimeException(Throwable cause, String message)
Creates a new AthRuntimeException with a given message and parent exception cause.- Parameters:
cause- the underlying exception that caused this exceptionmessage- the descriptive text of the exception message
-
AthRuntimeException
public AthRuntimeException(Throwable cause, String format, Object... args)
Creates a new AthRuntimeException with a formatted message and cause.- Parameters:
cause- the underlying exception that caused this exceptionformat- the message format string with {} placeholdersargs- the arguments to substitute into the format string
-
-
Method Detail
-
logAndThrow
public static void logAndThrow(Class<?> loggingClass, Throwable cause, String format, Object... args)
Logs an error message with cause and throws an AthRuntimeException.- 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 {} placeholdersargs- the arguments to substitute into the format string- Throws:
AthRuntimeException- always throws an AthRuntimeException after logging
-
logAndThrow
public static void logAndThrow(Class<?> loggingClass, Throwable cause)
Logs an error with just the cause and throws an AthRuntimeException.- Parameters:
loggingClass- the class where the error occurred (for logging context)cause- the underlying exception that caused this error- Throws:
AthRuntimeException- always throws an AthRuntimeException after logging
-
logAndThrow
public static void logAndThrow(Class<?> loggingClass, String format, Object... args)
Logs an error message and throws an AthRuntimeException.- Parameters:
loggingClass- the class where the error occurred (for logging context)format- the error message format string with {} placeholdersargs- the arguments to substitute into the format string- Throws:
AthRuntimeException- always throws an AthRuntimeException after logging
-
-