Class ErrorHandler

java.lang.Object
de.uzl.its.swat.common.ErrorHandler

public class ErrorHandler extends Object
ErrorHandler is responsible for handling exceptions throughout the application. It decides whether to log the error or terminate the execution based on the application configuration.
  • Constructor Details

    • ErrorHandler

      public ErrorHandler()
      Constructs an ErrorHandler with a specified Config and ILogger implementation.
  • Method Details

    • handleException

      public void handleException(Exception e)
      Handles an exception by logging it with a default message. The action taken depends on the application configuration.
      Parameters:
      e - the exception to handle
    • handleException

      public void handleException(String msg, Throwable t)
      Handles an exception with a custom message. Depending on the application configuration, it either logs the error or terminates the execution by throwing a RuntimeException.
      Parameters:
      msg - the custom message to log along with the exception
      t - the throwable to handle