Example usage for org.springframework.boot.devtools.restart FailureHandler handle

List of usage examples for org.springframework.boot.devtools.restart FailureHandler handle

Introduction

In this page you can find the example usage for org.springframework.boot.devtools.restart FailureHandler handle.

Prototype

Outcome handle(Throwable failure);

Source Link

Document

Handle a run failure.

Usage

From source file:org.springframework.boot.devtools.restart.Restarter.java

/**
 * Start the application.//from www . j a  v a  2  s  .  c  om
 * @param failureHandler a failure handler for application that won't start
 * @throws Exception in case of errors
 */
protected void start(FailureHandler failureHandler) throws Exception {
    do {
        Throwable error = doStart();
        if (error == null) {
            return;
        }
        if (failureHandler.handle(error) == Outcome.ABORT) {
            if (error instanceof Exception) {
                throw (Exception) error;
            }
            throw new Exception(error);
        }
    } while (true);
}