From: Miro Richard Eklund Date: Fri, 3 Aug 2018 13:05:09 +0000 (+0300) Subject: Removed contact application support prints X-Git-Tag: v1.43.0~136^2~414 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=refs%2Fchanges%2F88%2F1988%2F2 Removed contact application support prints Unnecessary contact application support on error messages removed. gitlab #76 Change-Id: I6f3940fa5443e52eb7c9e21c7578579158b468c3 --- diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java index a964c90c9..d20ddae6c 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java @@ -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(); diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java index b1fbb5d9c..780ea4e05 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java @@ -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; diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java index b5da0b92f..4ef46e6c6 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java @@ -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 diff --git a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java index 390c0d17f..60e824cad 100644 --- a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java +++ b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java @@ -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()); } } diff --git a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java index 1d5001c64..82f4abdd9 100644 --- a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java +++ b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java @@ -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) { diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java index 5a1dea2b9..880bfd00d 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java @@ -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; } diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java index df3b6904f..6cab018a6 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java @@ -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(); diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java index f5b6611b7..30e0dde52 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java @@ -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); diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java index efd82b6ca..e0d8eee8a 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java @@ -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); diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java index 6581a4b65..1b715e343 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java @@ -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; } diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java index 158227353..3afb92fc8 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java @@ -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; diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java index 6063dc8d5..b24862a67 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java @@ -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(); diff --git a/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java index 63c2f0ac9..3a8f02573 100644 --- a/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java +++ b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java @@ -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) { diff --git a/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java index cb24def8c..6463ccbb2 100644 --- a/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java +++ b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java @@ -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) { diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java b/bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java index 760851432..8274facef 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java @@ -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);