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

org.ow2.bonita.facade.exception.BonitaInternalException Maven / Gradle / Ivy

package org.ow2.bonita.facade.exception;

import org.ow2.bonita.util.BonitaRuntimeException;
/**
 *
 * Thrown if an internal Bonita error occurred.
 * Please contact Bonita by using the mailing list bonita AT ow2.org
 * 
 * @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
 *
 */
public class BonitaInternalException extends BonitaRuntimeException {

  private static final long serialVersionUID = 2673048366400783426L;

  /**
   * Constructs a BonitaInternalException with the specified detail message and the throwable cause.
   * @param message msg the detail message.
   * @param cause exception causing the abort.
   */
  public BonitaInternalException(String message, Throwable cause) {
    super(message, cause);
  }

  /**
   * Constructs a BonitaInternalException with the specified detail message.
   * @param message the detail message.
   */
  public BonitaInternalException(String message) {
    super(message);
  }

  public static BonitaInternalException build(RuntimeException exception) {
    String message = exception.getMessage();
    if (exception instanceof BonitaRuntimeException) {
      return new BonitaInternalException(message, exception);
    }
    String newMessage = "Unexpected Exception arrived in Bonita: " + message;
    return new BonitaInternalException(newMessage, exception);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy