Browse Source

GUIComputationThread: Add method for logging generic Exceptions

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10482 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 11 years ago
parent
commit
a9630648b0
  1. 25
      prism/src/userinterface/GUIComputationThread.java

25
prism/src/userinterface/GUIComputationThread.java

@ -49,12 +49,35 @@ public class GUIComputationThread extends Thread
errorLog(s);
errorDialog(s);
}
/** Report an error for an Exception (in log and popup dialog) */
public void error(Exception e)
{
if (e instanceof jdd.JDD.CuddOutOfMemoryException) {
error(e.getMessage()+"\nPlease restart PRISM. You can increase the memory for CuDD in the settings...");
} else if (e instanceof PrismException) {
error(e.getMessage());
} else {
error(e.toString()+"\nThis is an unexpected error, it might be a good idea to restart PRISM");
}
}
/** Report an error (in log) */
public void errorLog(String s)
{
logln("\nError: " + s + ".");
}
/** Report an Exception error (in log) */
public void errorLog(Exception e)
{
if (e instanceof PrismException || e instanceof jdd.JDD.CuddOutOfMemoryException) {
logln("\nError: " + e.getMessage() + ".");
} else {
logln("\nError: " + e.toString() +".");
}
}
// send messages to log
public void log(Object o) { plug.log(o); }

Loading…
Cancel
Save