org.protege.editor.owl.model.UIReasonerExceptionHandler Maven / Gradle / Ivy
package org.protege.editor.owl.model;
import org.protege.editor.owl.model.inference.OWLReasonerExceptionHandler;
import javax.swing.*;
/*
* Copyright (C) 2007, University of Manchester
*
*
*/
/**
* Author: Matthew Horridge
* The University Of Manchester
* Bio-Health Informatics Group
* Date: 26-Nov-2007
*/
public class UIReasonerExceptionHandler implements OWLReasonerExceptionHandler {
private OWLWorkspace workspace;
public UIReasonerExceptionHandler(OWLWorkspace workspace) {
this.workspace = workspace;
}
public void handle(Throwable e) {
Throwable cause = e;
while(cause.getCause() != null) {
cause = cause.getCause();
}
String msg = cause.getClass().getSimpleName() + ": " + cause.getMessage();
JOptionPane.showMessageDialog(workspace, msg, "An error occurred during reasoning", JOptionPane.ERROR_MESSAGE);
}
}