Class ErrorReporterForTask

Object
ErrorReporterForTask
All Implemented Interfaces:
ErrorReporter

public class ErrorReporterForTask extends Object implements ErrorReporter
An error-reporter that replaces particular errors/exceptions with user-friendly messages.
Author:
Owen Feehan
  • Constructor Details

    • ErrorReporterForTask

      public ErrorReporterForTask(MessageLogger logger)
      Create to use a particular logger to report errors.
      Parameters:
      logger - the logger.
  • Method Details

    • recordError

      public void recordError(Class<?> classOriginating, Throwable exc)
      Description copied from interface: ErrorReporter
      Reports an error that occurred as an exception
      Specified by:
      recordError in interface ErrorReporter
      Parameters:
      classOriginating - a class in which the error originates (where it was thrown)
      exc - the error that occurred
    • recordError

      public void recordError(Class<?> classOriginating, String message)
      Description copied from interface: ErrorReporter
      Reports an error with a constant string error message.
      Specified by:
      recordError in interface ErrorReporter
      Parameters:
      classOriginating - a class in which the error originates (where it was thrown)
      message - a message describing the error that occurred
    • recordError

      public void recordError(Class<?> classOriginating, String message, Throwable exc)
      Description copied from interface: ErrorReporter
      Reports an error that occurred as an exception, with a message first introducing it.
      Specified by:
      recordError in interface ErrorReporter
      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

      public void recordWarning(String message)
      Description copied from interface: ErrorReporter
      Reports an warning with a constant string error message.
      Specified by:
      recordWarning in interface ErrorReporter
      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 interface ErrorReporter
      Returns:
      true if at least one warning has occurred, false otherwise.