diff --git a/prism/src/userinterface/model/GUIMultiModelHandler.java b/prism/src/userinterface/model/GUIMultiModelHandler.java index a61e8929..8e7236aa 100644 --- a/prism/src/userinterface/model/GUIMultiModelHandler.java +++ b/prism/src/userinterface/model/GUIMultiModelHandler.java @@ -776,11 +776,12 @@ public class GUIMultiModelHandler extends JPanel implements PrismModelListener theModel.notifyEventListeners(new GUIModelEvent(GUIModelEvent.MODEL_PARSED, parsedModel)); } - public synchronized void modelParseFailed(PrismLangException parserError, boolean background) + public synchronized void modelParseFailed(PrismException parserError, boolean background) { lastError = parserError.getMessage(); - editor.modelParseFailed(parserError, background); + if (parserError instanceof PrismLangException) + editor.modelParseFailed((PrismLangException) parserError, background); tree.stopParsing(); parsing = false; diff --git a/prism/src/userinterface/model/computation/ParseModelThread.java b/prism/src/userinterface/model/computation/ParseModelThread.java index 7cbf7058..f1e7fcdd 100644 --- a/prism/src/userinterface/model/computation/ParseModelThread.java +++ b/prism/src/userinterface/model/computation/ParseModelThread.java @@ -43,7 +43,7 @@ public class ParseModelThread extends GUIComputationThread private boolean background; private ModulesFile mod; private String errMsg; - private PrismLangException parseError; + private PrismException parseError; static int counter = 0; int id; long before; @@ -91,7 +91,7 @@ public class ParseModelThread extends GUIComputationThread } // Load into PRISM once done prism.loadPRISMModel(mod); - } catch (PrismLangException err) { + } catch (PrismException err) { parseError = err; errMsg = err.getMessage(); SwingUtilities.invokeLater(new Runnable() @@ -109,8 +109,6 @@ public class ParseModelThread extends GUIComputationThread } }); return; - } catch (PrismException e) { - throw new RuntimeException("Unexpected PrismException: " + e.getMessage()); } // If we get here, the parse has been successful, notify the interface and tell the handler.