提交 8503a4f8 authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved error messages.

上级 862b6e62
...@@ -143,7 +143,7 @@ public class MVPrimaryIndex extends BaseIndex { ...@@ -143,7 +143,7 @@ public class MVPrimaryIndex extends BaseIndex {
map.put(key, ValueArray.get(row.getValueList())); map.put(key, ValueArray.get(row.getValueList()));
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
table.getName()); e, table.getName());
} }
lastKey = Math.max(lastKey, row.getKey()); lastKey = Math.max(lastKey, row.getKey());
} }
...@@ -167,7 +167,7 @@ public class MVPrimaryIndex extends BaseIndex { ...@@ -167,7 +167,7 @@ public class MVPrimaryIndex extends BaseIndex {
} }
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
table.getName()); e, table.getName());
} }
} }
...@@ -224,7 +224,7 @@ public class MVPrimaryIndex extends BaseIndex { ...@@ -224,7 +224,7 @@ public class MVPrimaryIndex extends BaseIndex {
long cost = 10 * (dataMap.sizeAsLongMax() + Constants.COST_ROW_OFFSET); long cost = 10 * (dataMap.sizeAsLongMax() + Constants.COST_ROW_OFFSET);
return cost; return cost;
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
...@@ -294,7 +294,7 @@ public class MVPrimaryIndex extends BaseIndex { ...@@ -294,7 +294,7 @@ public class MVPrimaryIndex extends BaseIndex {
try { try {
return dataMap.sizeAsLongMax(); return dataMap.sizeAsLongMax();
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
......
...@@ -208,7 +208,8 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -208,7 +208,8 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
try { try {
map.put(array, ValueNull.INSTANCE); map.put(array, ValueNull.INSTANCE);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, table.getName()); throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
e, table.getName());
} }
if (indexType.isUnique()) { if (indexType.isUnique()) {
Iterator<Value> it = map.keyIterator(unique, true); Iterator<Value> it = map.keyIterator(unique, true);
...@@ -245,7 +246,8 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -245,7 +246,8 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
getSQL() + ": " + row.getKey()); getSQL() + ": " + row.getKey());
} }
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, table.getName()); throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
e, table.getName());
} }
} }
...@@ -358,7 +360,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -358,7 +360,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
return 10 * getCostRangeIndex(masks, return 10 * getCostRangeIndex(masks,
dataMap.sizeAsLongMax(), filter, sortOrder); dataMap.sizeAsLongMax(), filter, sortOrder);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
...@@ -408,7 +410,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -408,7 +410,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
try { try {
return dataMap.sizeAsLongMax() == 0; return dataMap.sizeAsLongMax() == 0;
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
...@@ -423,7 +425,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -423,7 +425,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
try { try {
return dataMap.sizeAsLongMax(); return dataMap.sizeAsLongMax();
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
......
...@@ -137,7 +137,8 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex { ...@@ -137,7 +137,8 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
try { try {
map.put(key, ValueLong.get(0)); map.put(key, ValueLong.get(0));
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, table.getName()); throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
e, table.getName());
} }
if (indexType.isUnique()) { if (indexType.isUnique()) {
// check if there is another (uncommitted) entry // check if there is another (uncommitted) entry
...@@ -183,7 +184,8 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex { ...@@ -183,7 +184,8 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
getSQL() + ": " + row.getKey()); getSQL() + ": " + row.getKey());
} }
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, table.getName()); throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
e, table.getName());
} }
} }
...@@ -291,7 +293,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex { ...@@ -291,7 +293,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
try { try {
return dataMap.sizeAsLongMax() == 0; return dataMap.sizeAsLongMax() == 0;
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
...@@ -306,7 +308,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex { ...@@ -306,7 +308,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
try { try {
return dataMap.sizeAsLongMax(); return dataMap.sizeAsLongMax();
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED, e);
} }
} }
......
...@@ -354,9 +354,6 @@ public class MVTableEngine implements TableEngine { ...@@ -354,9 +354,6 @@ public class MVTableEngine implements TableEngine {
// disk full - ok // disk full - ok
} else if (errorCode == DataUtils.ERROR_FILE_CORRUPT) { } else if (errorCode == DataUtils.ERROR_FILE_CORRUPT) {
// wrong encryption key - ok // wrong encryption key - ok
} else {
// something else
// TODO log those issues when running unit tests
} }
store.closeImmediately(); store.closeImmediately();
throw DbException.get(ErrorCode.IO_EXCEPTION_1, e, "Closing"); throw DbException.get(ErrorCode.IO_EXCEPTION_1, e, "Closing");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论