X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2FFunctions.java;h=0a7e004f7dcab5e75740d176100c78d59c3dfb47;hp=9c62924153681a788159cb40c0420468bc415387;hb=8a609b2a6559fef3d2f21224253d87c414473187;hpb=ab9d7c411f5de4e4453e9bfb893c5a7559202fdb diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java index 9c6292415..0a7e004f7 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java @@ -583,6 +583,7 @@ public class Functions { } } + @Deprecated public static AbstractEventHandler emptyOnClick(ReadGraph graph) throws DatabaseException { return new EventHandler() { @Override @@ -592,6 +593,7 @@ public class Functions { }; } + @Deprecated public static AbstractEventHandler writeEventHandler(ReadGraph graph, final Variable variable, final Function fn) { final Session session = graph.getSession(); @@ -624,15 +626,11 @@ public class Functions { return (String)response; } return null; - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); } - return null; - } }); @@ -649,6 +647,7 @@ public class Functions { }; } + @Deprecated public static AbstractEventHandler readEventHandler(ReadGraph graph, final Variable variable, final Function fn) { final Session session = graph.getSession(); @@ -681,15 +680,11 @@ public class Functions { return (String)response; } return null; - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); } - return null; - } }); @@ -706,6 +701,7 @@ public class Functions { }; } + @Deprecated public static AbstractEventHandler readEventHandler2(ReadGraph graph, final Function fn) { final Session session = graph.getSession(); @@ -732,15 +728,11 @@ public class Functions { return (CommandResult)response; } return null; - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); } - return null; - } }); @@ -830,10 +822,7 @@ public class Functions { Object oldGraph = sclContext.put("graph", graph); Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer); try { - Object response = fn.apply(parameters); - return response; - } catch (Throwable t) { - return new org.simantics.document.server.serverResponse.Error(formatError(graph, t)); + return fn.apply(parameters); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); @@ -854,10 +843,7 @@ public class Functions { Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer); try { - Object response = fn.apply(parameters); - return response; - } catch (Throwable t) { - return new org.simantics.document.server.serverResponse.Error(formatError(graph, t)); + return fn.apply(parameters); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); @@ -899,6 +885,7 @@ public class Functions { }; } + @Deprecated public static AbstractEventHandler writeEventHandler2(ReadGraph graph, final Function fn) { final Session session = graph.getSession(); @@ -925,15 +912,11 @@ public class Functions { return (CommandResult)response; } return null; - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put("graph", oldGraph); sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); } - return null; - } }); @@ -950,6 +933,8 @@ public class Functions { }; } + + @Deprecated public static AbstractEventHandler eventHandler2(ReadGraph graph, final Function fn) { return new AbstractEventHandler() { @@ -969,14 +954,10 @@ public class Functions { return (CommandResult)response; } return null; - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); } - return null; - } catch (Throwable e) { Logger.defaultLogError(e); return new org.simantics.document.server.serverResponse.Error(e.getMessage()); @@ -987,6 +968,7 @@ public class Functions { }; } + @Deprecated public static AbstractEventHandler eventHandler(ReadGraph graph, final Function fn) { return new AbstractEventHandler() { @@ -1013,8 +995,6 @@ public class Functions { if(response instanceof String) { result = (String)response; } - } catch (Throwable t) { - t.printStackTrace(); } finally { sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); }