Removed contact application support prints 88/1988/2
authorMiro Richard Eklund <miro.eklund@semantum.fi>
Fri, 3 Aug 2018 13:05:09 +0000 (16:05 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 4 Aug 2018 14:45:50 +0000 (17:45 +0300)
Unnecessary contact application support on error messages removed.

gitlab #76

Change-Id: I6f3940fa5443e52eb7c9e21c7578579158b468c3

15 files changed:
bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java
bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java
bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java
bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java
bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java
bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java

index a964c90..d20ddae 100644 (file)
@@ -596,7 +596,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
@@ -642,7 +642,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
index b1fbb5d..780ea4e 100644 (file)
@@ -198,7 +198,7 @@ public final class ClusterChange {
         }
         if (0 != foreign) {
             if (foreign > 256)
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
+                throw new RuntimeDatabaseException("Internal error." +
                 "Too big foreing index=" + foreign + " max=256");
             --foreign;
             bytes[byteIndex++] = foreign;
@@ -211,7 +211,7 @@ public final class ClusterChange {
             if (DEBUG_STAT)
                 info.sForeign = foreignTable.size();
             if (clusterUID.equals(ClusterUID.Null))
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
+                throw new RuntimeDatabaseException("Internal error." +
                 "Cluster unique id not defined for foreing cluster.");
             addForeignLong(resourceIndex, clusterUID);
             return ClusterEnum.ForeignLong;
index b5da0b9..4ef46e6 100644 (file)
@@ -5638,7 +5638,7 @@ public class ReadGraphImpl implements AsyncReadGraph {
         * Internal routines
         */
 
-       protected static String INTERNAL_ERROR_STRING = "Transaction aborted due to internal client error. Contact application support.";
+       protected static String INTERNAL_ERROR_STRING = "Transaction aborted due to internal client error.";
 
        /*
         * callerThread is the currently running thread state.syncThread is blocking for
index 390c0d1..60e824c 100644 (file)
@@ -174,9 +174,8 @@ public class IndexedRelationsImpl implements IndexedRelations {
                // 3. something was wrong, but the index has been successfully cleaned
        }
 
-               if(!searcher.checkState(State.NONE)) 
-                       throw new IndexException("Illegal searcher state, contact application support.");
-       
+       searcher.assertState(State.NONE);
+
         // We loop until the index is loaded
         while(true) {
                
@@ -240,7 +239,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                                                                if(!loaded) {
                                                                        
                                                                if(!searcher.checkState(State.NONE)) 
-                                                                       throw new DatabaseException("Illegal searcher state, contact application support.");                                                            
+                                                                       throw new DatabaseException("Illegal searcher state " + searcher.state());
 
                                                                        try {
                                                                            SerialisationSupport ss = graph.getService(SerialisationSupport.class);
@@ -273,7 +272,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                        }
                        
                        if(!success)
-                               throw new IndexException("Did not manage to load index. Contact application support.");
+                               throw new IndexException("Did not manage to load index.");
                
                // Try again
 
@@ -283,7 +282,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                        if (searcher.isIndexAvailable()) {
                                searcher.startAccess(progress.newChild(50), processor.getSession(), false);
                                if(searcher.hasAccess(false)) return lock;
-                               throw new IndexException("Illegal searcher state, contact application support.");
+                               throw new IndexException("Illegal searcher state " + searcher.state());
                        }
                        
                }
index 1d5001c..82f4abd 100644 (file)
@@ -64,6 +64,7 @@ import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.indexing.internal.IndexingJob;
 import org.simantics.db.layer0.adapter.GenericRelation;
+import org.simantics.db.layer0.genericrelation.IndexException;
 import org.simantics.db.request.Read;
 import org.simantics.db.service.CollectionSupport;
 import org.simantics.db.service.SerialisationSupport;
@@ -115,14 +116,18 @@ abstract public class IndexedRelationsSearcherBase {
        this.state = State.READY;
     }
     
+    public State state() {
+       return state;
+    }
+    
     protected boolean checkState(State state) {
        return this.state == state;
     }
     
-    protected void assertState(State state) throws AssertionError {
-
-       if(this.state != state) throw new AssertionError("Illegal state, expected " + state.name() + " but was in " + this.state.name());
-       
+    protected void assertState(State state) throws IndexException {
+        State s = this.state;
+        if (s != state)
+            throw new IndexException("Illegal index searcher state, expected " + state.name() + " but state was " + s.name());
     }
     
     public void changeState(IProgressMonitor monitor, Session session, State state) {
index 5a1dea2..880bfd0 100644 (file)
@@ -201,8 +201,8 @@ public final class ClusterChange {
         }
         if (0 != foreign) {
             if (foreign > 256)
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
-                "Too big foreing index=" + foreign + " max=256");
+                throw new RuntimeDatabaseException("Internal error." +
+                "Too big foreign index=" + foreign + " max=256");
             --foreign;
             bytes[byteIndex++] = foreign;
             return ClusterEnum.ForeignShort;
@@ -214,8 +214,8 @@ public final class ClusterChange {
             if (DEBUG_STAT)
                 info.sForeign = foreignTable.size();
             if (clusterUID.equals(ClusterUID.Null))
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
-                "Cluster unique id not defined for foreing cluster.");
+                throw new RuntimeDatabaseException("Internal error." +
+                "Cluster unique id not defined for foreign cluster.");
             addForeignLong(resourceIndex, clusterUID);
             return ClusterEnum.ForeignLong;
         }
index df3b690..6cab018 100644 (file)
@@ -135,7 +135,7 @@ public final class ClusterTable implements IClusterTable {
             int clusterKey = hashMap.size();
             ClusterSmall sentinel = new ClusterSmall(clusterUID, clusterKey, ClusterTable.this, sessionImpl.clusterTranslator);
             if (sentinel.clusterId != sentinel.clusterUID.second)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             create(sentinel);
             return sentinel;
         }
@@ -144,25 +144,25 @@ public final class ClusterTable implements IClusterTable {
             create(proxy);
             if (null != old) {
                 if (old.clusterKey != proxy.clusterKey)
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
                 if (old.clusterId != proxy.clusterId)
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
                 if (!old.clusterUID.equals(proxy.clusterUID))
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
             }
         }
         private ClusterSmall freeProxy(ClusterImpl proxy) {
             ClusterImpl clusterImpl = hashMap.get(proxy.clusterId);
             if (null == clusterImpl)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
 //            ClusterUID clusterUID = ClusterUID.make(0, proxy.clusterId);
 //            ClusterImpl clusterImpl2 = clusterU2I.get(clusterUID );
 //            if (clusterImpl != clusterImpl2)
-//                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+//                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             if (proxy.clusterId != clusterImpl.clusterId)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             if (proxy.clusterKey != clusterImpl.clusterKey)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             ClusterSmall sentinel = new ClusterSmall(makeClusterUID(proxy.clusterId) , proxy.clusterKey, ClusterTable.this, sessionImpl.clusterTranslator);
             return (ClusterSmall)create(sentinel);
         }
@@ -595,7 +595,7 @@ public final class ClusterTable implements IClusterTable {
     void removeWriteOnlyClusters() {
         for (ClusterI proxy : writeOnlyClusters) {
             if (!(proxy instanceof ClusterImpl))
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             clusters.freeProxy((ClusterImpl)proxy);
         }
         writeOnlyClusters.clear();
index f5b6611..30e0dde 100644 (file)
@@ -506,7 +506,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 //                        state.cancelCommit(context, clusterStream);
 //                        if (!empty) {
 //                            if (!context.isOk()) // this is a blocking operation
-//                                throw new InternalException("Cancel failed. This should never happen. Contact application support.");
+//                                throw new InternalException("Cancel failed. This should never happen.");
 //                            getQueryProvider2().performDirtyUpdates(writeState.getGraph());
 //                        }
 //                        state.cancelCommit2(context, clusterStream);
index efd82b6..e0d8eee 100644 (file)
@@ -287,7 +287,7 @@ class State {
                     try {
                         final boolean undo = false;
                         if (!context.isOk(undo)) // this is a blocking operation
-                            throw new InternalException("Cancel failed. This should never happen. Contact application support.");
+                            throw new InternalException("Cancel failed. This should never happen.");
 //                        System.out.println("session cs: " + session.clientChanges);
 //                        System.out.println("reverse cs: " + cs);
                         queryProvider.performDirtyUpdates(graph);
index 6581a4b..1b715e3 100644 (file)
@@ -163,7 +163,7 @@ class CCSParser {
                 args.removeRelation(ri, pdata.resource, pdata.clusterUID, odata.resource, odata.clusterUID);
                 break;
             default:
-                new RuntimeException("Internal error. Contact application support.");
+                new RuntimeException("Internal error, unrecognized StmEnum value encountered: " + stmEnum);
         }
         return ap;
     }
index 1582273..3afb92f 100644 (file)
@@ -309,7 +309,7 @@ public class ClusterChangeSet implements ClusterChangeSetI {
                     p = CCSParser.parseStm(StmEnum.Add, args, bytes, p, 4, ReferenceType.ForeignLong, ReferenceType.ForeignShort);
                     break;
                 default:
-                    throw new RuntimeException("Internal error, contact application support.");
+                    throw new RuntimeException("Internal error in cluster stream (v=" + kraa + ")");
             }
         }
         return p - pb;
index 6063dc8..b24862a 100644 (file)
@@ -576,7 +576,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
index 63c2f0a..3a8f025 100644 (file)
@@ -79,7 +79,7 @@ public class StageEditHandler extends AbstractPreferenceHandler {
                     msg = new String(data, Charset.defaultCharset());
                 }
                 if (msg.isEmpty() || msg.matches(" *"))
-                    msg = "Staging crashed. Contact application support.";
+                    msg = "Staging crashed.";
                 ShowError.showError("Staging failed, errorcode="+result.getExitValue(), msg, new Exception());
             }
             if (result.getMessageLog() != null) {
index cb24def..6463ccb 100644 (file)
@@ -112,7 +112,7 @@ public class SynchroniseAllHandler extends AbstractPreferenceHandler {
                     msg = new String(data, Charset.defaultCharset());
                 }
                 if (msg.isEmpty() || msg.matches(" *"))
-                    msg = "Staging crashed and burned. Contact application support.";
+                    msg = "Staging crashed and burned.";
                 ShowError.showError("Staging failed, errorcode="+result.getExitValue(), msg, new Exception());
             }
             if (result.getMessageLog() != null) {
index 7608514..8274fac 100644 (file)
@@ -161,7 +161,7 @@ public class WorkbenchWindowSessionContextProviderSource implements ISessionCont
         synchronized (providers) {
             if (providers.put(context, p) != null) {
                 // This is a bug, should never happen.
-                throw new Error("Bug encountered, contact application support with stack trace.");
+                throw new Error("Unexpected bug, this should never happen!");
             }
             allProviders = providers.values().toArray(ZERO);
         }
@@ -172,7 +172,7 @@ public class WorkbenchWindowSessionContextProviderSource implements ISessionCont
             ISessionContextProvider provider = providers.remove(context);
             if (provider == null) {
                 // This is a bug, should never happen.
-                throw new Error("Bug encountered, contact application support with stack trace.");
+                throw new Error("Unexpected bug, this should never happen!");
             }
             allProviders = providers.values().toArray(ZERO);