public final class ExceptionClassifier extends Object implements IExceptionClassifier
The errors from services are always severe, because no direct user interaction is available. The classes that handle these errors will probably not use this helper class.
The errors from the user interface can also be divided into two types:
This class determines the type of error and reports back to the caller whether it is severe or not.
| Modifier and Type | Class and Description |
|---|---|
static class |
ExceptionClassifier.Severity
The severity of the exception
|
| Constructor and Description |
|---|
ExceptionClassifier() |
| Modifier and Type | Method and Description |
|---|---|
ExceptionClassifier.Severity |
getExceptionSeverity(Throwable e) |
static ExceptionClassifier |
getInstance() |
boolean |
isSevereException(Throwable throwable)
Convenience method that returns true when the Throwable is found to be
classified as SEVERE or UNKNOWN.
|
void |
registerClassifier(IExceptionClassifier exceptionClassifier)
Some exceptions do not have a fixed String like most Oracle messages.
|
void |
registerKnownException(String message,
ExceptionClassifier.Severity severity)
By registering a known exception you make clear to this class which exception-message should be considered severe or not.
|
@Nonnull public static ExceptionClassifier getInstance()
public void registerKnownException(@Nonnull String message, @Nonnull ExceptionClassifier.Severity severity) throws Exception
String - messageBoolean - severeExceptionpublic void registerClassifier(@Nonnull IExceptionClassifier exceptionClassifier)
exceptionClassifier - @Nonnull public ExceptionClassifier.Severity getExceptionSeverity(@Nonnull Throwable e)
getExceptionSeverity in interface IExceptionClassifierCopyright © 2017 etc.to. All rights reserved.