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

Improved error messages.

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