Elektra  0.9.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
org.libelektra.KDBException Class Referenceabstract

Wraps Elektra errors into the corresponding Java exceptions. More...

Inherits Exception.

Inherited by org.libelektra.exception.ConflictingStateException, org.libelektra.exception.PermanentException, and org.libelektra.exception.ValidationException.

Public Member Functions

void releaseErrorKey ()
 Release the key backing this KDBException. More...
 
Key getErrorKey ()
 
String getErrorNumber ()
 
String getConfigFile ()
 
String getMountpoint ()
 
String getDebugInformation ()
 
String getModule ()
 
String getReason ()
 
String getMessage ()
 
boolean hasWarnings ()
 If an error occurred it may also has important warnings which caused the error. More...
 
List< WarningEntry > getWarnings ()
 

Static Public Member Functions

static KDBException getMappedException (Key errorKey)
 Extracts warnings and error information and maps it to an appropriate exception. More...
 

Protected Member Functions

 KDBException (Key errorKey)
 

Detailed Description

Wraps Elektra errors into the corresponding Java exceptions.

See also
releaseErrorKey()

Constructor & Destructor Documentation

◆ KDBException()

org.libelektra.KDBException.KDBException ( Key  errorKey)
inlineprotected
Parameters
errorKeyKey containing
error/*
and
warnings/*
meta keys

Member Function Documentation

◆ getConfigFile()

String org.libelektra.KDBException.getConfigFile ( )
inline
Returns
The affected configuration file of the error or if not available returns the error key name
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getDebugInformation()

String org.libelektra.KDBException.getDebugInformation ( )
inline
Returns
Elektra specific debug information in the form of "At: file:line"
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getErrorKey()

Key org.libelektra.KDBException.getErrorKey ( )
inline
Returns
Key containing
error/*
and
warnings/*
meta keys backing this exception

◆ getErrorNumber()

String org.libelektra.KDBException.getErrorNumber ( )
inline
Returns
Elektra error number read from the error key backing this exception
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getMappedException()

static KDBException org.libelektra.KDBException.getMappedException ( Key  errorKey)
inlinestatic

Extracts warnings and error information and maps it to an appropriate exception.

Parameters
errorKeyKey containing
error/*
and
warnings/*
meta keys
Returns
KDBException corresponding to the error information
Exceptions
KeyReleasedExceptionif this
errorKey
has already been released
IllegalArgumentExceptionif
errorKey
is
null

◆ getMessage()

String org.libelektra.KDBException.getMessage ( )
inline
Returns
The complete error information in a String with config file, mount point and debug information as it would be printed in the terminal
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getModule()

String org.libelektra.KDBException.getModule ( )
inline
Returns
Module which issued the error
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getMountpoint()

String org.libelektra.KDBException.getMountpoint ( )
inline
Returns
Mountpoint of the configuration
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getReason()

String org.libelektra.KDBException.getReason ( )
inline
Returns
Error reason read from the error key backing this exception
Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released

◆ getWarnings()

List<WarningEntry> org.libelektra.KDBException.getWarnings ( )
inline
Returns
Additional warnings emitted with the error

◆ hasWarnings()

boolean org.libelektra.KDBException.hasWarnings ( )
inline

If an error occurred it may also has important warnings which caused the error.

Returns
True if additional warnings were emitted, false otherwise

◆ releaseErrorKey()

void org.libelektra.KDBException.releaseErrorKey ( )
inline

Release the key backing this KDBException.

Exceptions
KeyReleasedExceptionif this error key backing this KDBException has already been released @apiNote If this exception does not terminate your process, consider releasing the backing error key after processing it

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