Unnecessary contact application support on error messages removed.
gitlab #76
Change-Id: I6f3940fa5443e52eb7c9e21c7578579158b468c3
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();
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();
}
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;
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;
* 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
// 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) {
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);
}
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
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());
}
}
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;
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) {
}
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;
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;
}
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;
}
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);
}
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();
// 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);
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);
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;
}
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;
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();
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) {
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) {
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);
}
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);