Class ErrorReporterForTask
Object
ErrorReporterForTask
- All Implemented Interfaces:
ErrorReporter
An error-reporter that replaces particular errors/exceptions with user-friendly messages.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionErrorReporterForTask
(MessageLogger logger) Create to use a particular logger to report errors. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if at least one warning has been outputted.void
recordError
(Class<?> classOriginating, String message) Reports an error with a constant string error message.void
recordError
(Class<?> classOriginating, String message, Throwable exc) Reports an error that occurred as an exception, with a message first introducing it.void
recordError
(Class<?> classOriginating, Throwable exc) Reports an error that occurred as an exceptionvoid
recordWarning
(String message) Reports an warning with a constant string error message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.anchoranalysis.core.log.error.ErrorReporter
recordErrorFormatted, recordWarningFormatted
-
Constructor Details
-
ErrorReporterForTask
Create to use a particular logger to report errors.- Parameters:
logger
- the logger.
-
-
Method Details
-
recordError
Description copied from interface:ErrorReporter
Reports an error that occurred as an exception- Specified by:
recordError
in interfaceErrorReporter
- Parameters:
classOriginating
- a class in which the error originates (where it was thrown)exc
- the error that occurred
-
recordError
Description copied from interface:ErrorReporter
Reports an error with a constant string error message.- Specified by:
recordError
in interfaceErrorReporter
- Parameters:
classOriginating
- a class in which the error originates (where it was thrown)message
- a message describing the error that occurred
-
recordError
Description copied from interface:ErrorReporter
Reports an error that occurred as an exception, with a message first introducing it.- Specified by:
recordError
in interfaceErrorReporter
- Parameters:
classOriginating
- a class in which the error originates (where it was thrown).message
- the message explaining the error.exc
- the error that occurred.
-
recordWarning
Description copied from interface:ErrorReporter
Reports an warning with a constant string error message.- Specified by:
recordWarning
in interfaceErrorReporter
- Parameters:
message
- a message describing the warning.
-
hasWarningOccurred
public boolean hasWarningOccurred()Description copied from interface:ErrorReporter
Checks if at least one warning has been outputted.- Specified by:
hasWarningOccurred
in interfaceErrorReporter
- Returns:
- true if at least one warning has occurred, false otherwise.
-