Utility enum for handling and analyzing exceptions. More...
Public Member Functions | |
| SQLInvalidAuthorizationSpecException | findSQLInvalidAuthException (Throwable e) |
Searches recursively through the exception chain to find the first SQLInvalidAuthorizationSpecException, starting from the given Throwable. | |
| private< T extends Throwable > T | logAndInstantiate (String message, Throwable cause, BiFunction< String, Throwable, T > factory, String defaultMsg, String logPrefix) |
| Internal generic helper to centralize logging logic and exception instantiation. | |
| FolderCreationException | logAndInstantiateFolderCreation (String message) |
Logs an error and creates a FolderCreationException without a cause. | |
| FolderCreationException | logAndInstantiateFolderCreation (String message, Throwable cause) |
Logs an error and creates a FolderCreationException with an optional cause. | |
| IllegalArgumentException | logAndInstantiateIllegalArgument (String message) |
Logs the given message and returns an instance of IllegalArgumentException with it. | |
| IllegalArgumentException | logAndInstantiateIllegalArgument (String message, Throwable cause) |
Logs the message and cause, then returns an IllegalArgumentException. | |
| IllegalStateException | logAndInstantiateIllegalState (String message) |
Logs an error and returns an IllegalStateException. | |
| LogbackConfigurationException | logAndInstantiateLogbackConfig (String message, Throwable cause) |
Logs an error and returns a LogbackConfigurationException. | |
| ResourceLoadException | logAndInstantiateResourceLoad (String message, Throwable cause) |
Logs an error and creates a ResourceLoadException for any resource (audio, image, etc.). | |
| UncheckedIOException | logAndInstantiateUncheckedIO (String message, IOException cause) |
Logs an error and returns an UncheckedIOException. | |
| UnsupportedOperationException | logAndInstantiateUnsupportedOperation (String message) |
Logs an error and returns an UnsupportedOperationException without a cause. | |
| UnsupportedOperationException | logAndInstantiateUnsupportedOperation (String message, Throwable cause) |
Logs an error and returns an UnsupportedOperationException. | |
| void | logAndThrowIllegalArgumentIfBlank (String value, String message) |
Logs the given message and throws an IllegalArgumentException if the given string is null, empty, or blank (only whitespace). | |
Public Attributes | |
| INSTANCE | |
Static Public Attributes | |
| static final String | EXCEPTION = "Exception" |
Static Private Attributes | |
| static final Logger | LOG = LoggerFactory.getLogger(ExceptionTools.class) |
Utility enum for handling and analyzing exceptions.
This enum provides methods to search for specific exception types within exception chains and centralizes error logging.
| SQLInvalidAuthorizationSpecException fr.softsf.sudokufx.common.exception.ExceptionTools.findSQLInvalidAuthException | ( | Throwable | e | ) |
Searches recursively through the exception chain to find the first SQLInvalidAuthorizationSpecException, starting from the given Throwable.
| e | the Throwable to inspect (may be null) |
null if not found | private< T extends Throwable > T fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiate | ( | String | message, |
| Throwable | cause, | ||
| BiFunction< String, Throwable, T > | factory, | ||
| String | defaultMsg, | ||
| String | logPrefix ) |
Internal generic helper to centralize logging logic and exception instantiation.
| <T> | the type of the exception to instantiate |
| message | custom context message; if null or blank, a default message is used |
| cause | original exception cause; may be null |
| factory | functional interface to create the exception (e.g., Exception::new) |
| defaultMsg | default message if the provided one is blank |
| logPrefix | specific prefix for the log message |
| FolderCreationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateFolderCreation | ( | String | message | ) |
Logs an error and creates a FolderCreationException without a cause.
| message | descriptive message of the failure; if null or blank, a default message is used |
FolderCreationException instance | FolderCreationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateFolderCreation | ( | String | message, |
| Throwable | cause ) |
Logs an error and creates a FolderCreationException with an optional cause.
| message | descriptive message of the failure; if null or blank, a default message is used |
| cause | the underlying exception that triggered the failure; may be null |
FolderCreationException instance | IllegalArgumentException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateIllegalArgument | ( | String | message | ) |
Logs the given message and returns an instance of IllegalArgumentException with it.
| message | the error message |
| IllegalArgumentException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateIllegalArgument | ( | String | message, |
| Throwable | cause ) |
Logs the message and cause, then returns an IllegalArgumentException.
| message | the error message |
| cause | the original exception that triggered the failure; may be null |
| IllegalStateException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateIllegalState | ( | String | message | ) |
Logs an error and returns an IllegalStateException.
| message | descriptive message |
| LogbackConfigurationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateLogbackConfig | ( | String | message, |
| Throwable | cause ) |
Logs an error and returns a LogbackConfigurationException.
| message | descriptive message of the failure; may be null or blank |
| cause | the original exception that triggered the failure; may be null |
LogbackConfigurationException instance | ResourceLoadException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateResourceLoad | ( | String | message, |
| Throwable | cause ) |
Logs an error and creates a ResourceLoadException for any resource (audio, image, etc.).
Handles null or blank messages and a null cause safely.
| message | descriptive message of the failure; may be null or blank |
| cause | the original exception that triggered the failure; may be null |
ResourceLoadException instance | UncheckedIOException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateUncheckedIO | ( | String | message, |
| IOException | cause ) |
Logs an error and returns an UncheckedIOException.
| message | descriptive message |
| cause | the original IOException |
| UnsupportedOperationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateUnsupportedOperation | ( | String | message | ) |
Logs an error and returns an UnsupportedOperationException without a cause.
| message | descriptive message |
| UnsupportedOperationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateUnsupportedOperation | ( | String | message, |
| Throwable | cause ) |
Logs an error and returns an UnsupportedOperationException.
| message | descriptive message |
| cause | the original exception; may be null |
| void fr.softsf.sudokufx.common.exception.ExceptionTools.logAndThrowIllegalArgumentIfBlank | ( | String | value, |
| String | message ) |
Logs the given message and throws an IllegalArgumentException if the given string is null, empty, or blank (only whitespace).
| value | the string to check |
| message | the error message |
| IllegalArgumentException | if the string is blank or null |
|
static |
| fr.softsf.sudokufx.common.exception.ExceptionTools.INSTANCE |
|
staticprivate |