SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.common.exception.ExceptionTools Enum Reference

Utility enum for handling and analyzing exceptions. More...

+ Collaboration diagram for fr.softsf.sudokufx.common.exception.ExceptionTools:

Public Member Functions

SQLInvalidAuthorizationSpecException findSQLInvalidAuthException (Throwable e)
 Searches recursively through the exception chain to find the first SQLInvalidAuthorizationSpecException, starting from the given Throwable.
 
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.
 
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.).
 
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 Private Attributes

static final Logger LOG = LoggerFactory.getLogger(ExceptionTools.class)
 

Detailed Description

Utility enum for handling and analyzing exceptions.

This enum provides methods to search for specific exception types within exception chains.

Member Function Documentation

◆ findSQLInvalidAuthException()

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.

Parameters
ethe Throwable to inspect (may be null)
Returns
the first SQLInvalidAuthorizationSpecException found, or null if not found

◆ logAndInstantiateFolderCreation() [1/2]

FolderCreationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateFolderCreation ( String message)

Logs an error and creates a FolderCreationException without a cause.

Parameters
messagedescriptive message of the failure; if null or blank, a default message is used
Returns
a new FolderCreationException instance
+ Here is the call graph for this function:

◆ logAndInstantiateFolderCreation() [2/2]

FolderCreationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateFolderCreation ( String message,
Throwable cause )

Logs an error and creates a FolderCreationException with an optional cause.

Parameters
messagedescriptive message of the failure; if null or blank, a default message is used
causethe underlying exception that triggered the failure; may be null
Returns
a new FolderCreationException instance

◆ logAndInstantiateIllegalArgument()

IllegalArgumentException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateIllegalArgument ( String message)

Logs the given message and returns an instance of IllegalArgumentException with it.

Parameters
messagethe error message
Returns
the IllegalArgumentException instance (not thrown)

◆ logAndInstantiateLogbackConfig()

LogbackConfigurationException fr.softsf.sudokufx.common.exception.ExceptionTools.logAndInstantiateLogbackConfig ( String message,
Throwable cause )

Logs an error and returns a LogbackConfigurationException.

The exception is instantiated (not thrown) to allow flexible handling by the caller.

Parameters
messagedescriptive message of the failure; may be null or blank
causethe original exception that triggered the failure; may be null
Returns
a new LogbackConfigurationException instance

◆ logAndInstantiateResourceLoad()

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.

Parameters
messagedescriptive message of the failure; may be null or blank
causethe original exception that triggered the failure; may be null
Returns
a new ResourceLoadException instance

◆ logAndThrowIllegalArgumentIfBlank()

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).

Parameters
valuethe string to check
messagethe error message
Exceptions
IllegalArgumentExceptionif the string is blank or null

Member Data Documentation

◆ INSTANCE

fr.softsf.sudokufx.common.exception.ExceptionTools.INSTANCE

◆ LOG

final Logger fr.softsf.sudokufx.common.exception.ExceptionTools.LOG = LoggerFactory.getLogger(ExceptionTools.class)
staticprivate

The documentation for this enum was generated from the following file: