Package com.compomics.util.exceptions
Class ExceptionHandler
java.lang.Object
com.compomics.util.exceptions.ExceptionHandler
- Direct Known Subclasses:
CommandLineExceptionHandler,FrameExceptionHandler,WaitingDialogExceptionHandler
Interface for the general handling of exceptions.
- Author:
- Marc Vaudel
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of caught exceptions.protected booleanIf true exceptions will be ignored. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCatches an exception and informs the user.static StringReturns the exception type.protected abstract voidNotifies the user that an exception was caught.voidsetIgnoreExceptions(boolean ignoreExceptions) Sets whether exceptions should be ignored.
-
Field Details
-
exceptionCaught
List of caught exceptions. -
ignoreExceptions
protected boolean ignoreExceptionsIf true exceptions will be ignored.
-
-
Constructor Details
-
ExceptionHandler
public ExceptionHandler()Empty default constructor
-
-
Method Details
-
catchException
Catches an exception and informs the user.- Parameters:
e- the exception caught
-
notifyUser
Notifies the user that an exception was caught.- Parameters:
e- the exception to catch
-
getExceptionType
Returns the exception type.- Parameters:
e- the exception to get the type fro- Returns:
- the exception type as a string
-
setIgnoreExceptions
public void setIgnoreExceptions(boolean ignoreExceptions) Sets whether exceptions should be ignored.- Parameters:
ignoreExceptions- if true exceptions will be ignored
-