Package es.urjc.etsii.grafo.exceptions
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 classI
- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerate stacktrace as string from throwablevoid
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?Methods inherited from class es.urjc.etsii.grafo.exception.ExceptionHandler
toString
-
Constructor Details
-
DefaultExceptionHandler
-
-
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 classExceptionHandler<S extends Solution<S,
I>, I extends Instance> - Parameters:
experimentName
- Experiment nameiteration
- Iteration if known, -1 if note
- Thrown exceptionsOptional
- Current solution, if availablei
- Current instancealgorithm
- Current algorithm
-
getStackTrace
Generate stacktrace as string from throwable- Parameters:
t
- Throwable- Returns:
- Stacktrace as string
-