[Label Expressions] Catch all Throwable exceptions
This allows us to open diagrams in case of serious errors
@@ -18,6 +18,7 @@ import com.archimatetool.model.IDiagramModelNote;
import com.archimatetool.model.IDiagramModelReference;
import com.archimatetool.model.IFolder;
import com.archimatetool.model.IJunction;
+import com.archimatetool.model.util.Logger;
/**
* Render Text for display in Text controls in diagrams
@@ -106,6 +107,7 @@ public class TextRenderer {
final int MAX_RECURSION = 10; // Max recursion level
+ try {
do {
// Add to result set
resultSet.add(result);
@@ -121,6 +123,11 @@ public class TextRenderer {
}
} while((!resultSet.contains(result)));
+ }
+ catch(Throwable t) { // Catch all errors so that we can continue working in case we can't open a diagram
+ Logger.logError("Error in Label Expression", t);
+ return "*** Error in Label Expression ***";
+ }
return renderEscapedCharacters(result);
}
