X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics%2Fsrc%2Forg%2Fsimantics%2FSimantics.java;h=cbe17e940d9436223aa6c2b62127872963a7b769;hp=c19efde85913a10c0ed6befba804d01f90b1fab7;hb=ab9d7c411f5de4e4453e9bfb893c5a7559202fdb;hpb=92faf11646c0b547de0b609adde82aa11d1282ca diff --git a/bundles/org.simantics/src/org/simantics/Simantics.java b/bundles/org.simantics/src/org/simantics/Simantics.java index c19efde85..cbe17e940 100644 --- a/bundles/org.simantics/src/org/simantics/Simantics.java +++ b/bundles/org.simantics/src/org/simantics/Simantics.java @@ -25,7 +25,6 @@ import org.simantics.application.arguments.IArguments; import org.simantics.application.arguments.SimanticsArguments; import org.simantics.db.ReadGraph; import org.simantics.db.RequestProcessor; -import org.simantics.db.RequestProcessorSpecific; import org.simantics.db.Resource; import org.simantics.db.Session; import org.simantics.db.WriteGraph; @@ -477,11 +476,12 @@ public class Simantics { } catch (ValueNotFound e) { throw new DatabaseException("SCL Value not found: " + e.name); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } } - @SuppressWarnings({ "unchecked", "rawtypes" }) public static T applySCL(String module, String function, ReadGraph graph, Object ... args) throws DatabaseException { SCLContext sclContext = SCLContext.getCurrent(); Object oldGraph = sclContext.put("graph", graph); @@ -503,6 +503,8 @@ public class Simantics { try { return (T)f.applyArray(args); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph); @@ -516,6 +518,8 @@ public class Simantics { try { return (T)f.applyArray(args); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph); @@ -528,6 +532,8 @@ public class Simantics { try { return function.apply(p0); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph); @@ -540,6 +546,8 @@ public class Simantics { try { return function.apply(p0); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph); @@ -552,6 +560,8 @@ public class Simantics { try { return function.apply(p0, p1); } catch (Throwable t) { + if (t instanceof DatabaseException) + throw (DatabaseException) t; throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph);