Class DefaultExceptionHandler<S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.exception.ExceptionHandler<S,I>
es.urjc.etsii.grafo.exceptions.DefaultExceptionHandler<S,I>
Type Parameters:
S - Solution class
I - Instance class

public class DefaultExceptionHandler<S extends Solution<S,I>,I extends Instance> extends ExceptionHandler<S,I>
Default exception handler. Executes when the user does not provide an exception handler implementation, and an unhandled exception reaches the Mork executor.
  • Constructor Details

    • DefaultExceptionHandler

      public DefaultExceptionHandler(IOManager<S,I> io)
  • Method Details

    • handleException

      public void handleException(String experimentName, int iteration, Exception e, Optional<S> sOptional, I i, Algorithm<S,I> algorithm)
      What should be done when there is an unhandled exception in the user algorithm implementation? Handle exception that is not controlled in the user code and reaches our executor. Behaviour can be customized or changed by extending the ExceptionHandler class.
      Specified by:
      handleException in class ExceptionHandler<S extends Solution<S,I>,I extends Instance>
      Parameters:
      experimentName - Experiment name
      iteration - Iteration if known, -1 if not
      e - Thrown exception
      sOptional - Current solution, if available
      i - Current instance
      algorithm - Current algorithm
    • getStackTrace

      public String getStackTrace(Throwable t)
      Generate stacktrace as string from throwable
      Parameters:
      t - Throwable
      Returns:
      Stacktrace as string