All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.routing.error.RoutingValidationException Maven / Gradle / Ivy

package org.opentripplanner.routing.error;

import java.util.concurrent.CompletionException;
import org.opentripplanner.routing.api.response.RoutingError;

import java.util.List;

public class RoutingValidationException extends RuntimeException {

  private static final long serialVersionUID = 1L;

  private final List routingErrors;

  /**
   * An error with the input data which results in itineraries not being returned for a type of
   * search.
   */
  public RoutingValidationException(List routingErrors) {
    this.routingErrors = routingErrors;
  }

  public List getRoutingErrors() {
    return routingErrors;
  }

  public static void unwrapAndRethrowCompletionException(CompletionException e) {
    if (e.getCause() instanceof RoutingValidationException) {
      throw (RoutingValidationException) e.getCause();
    } else if (e.getCause() instanceof RuntimeException) {
      throw (RuntimeException) e.getCause();
    }
    throw e;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy