提交 43d4262d authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not throw internal error from Value.convertTo()

上级 2622e11c
...@@ -1285,7 +1285,11 @@ public abstract class Value { ...@@ -1285,7 +1285,11 @@ public abstract class Value {
if (JdbcUtils.customDataTypesHandler != null) { if (JdbcUtils.customDataTypesHandler != null) {
return JdbcUtils.customDataTypesHandler.convert(this, targetType); return JdbcUtils.customDataTypesHandler.convert(this, targetType);
} }
throw DbException.throwInternalError("type=" + targetType); DataType from = DataType.getDataType(getType());
DataType to = DataType.getDataType(targetType);
throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1,
(from != null ? from.name : "type=" + getType()) + " to "
+ (to != null ? to.name : "type=" + targetType));
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw DbException.get( throw DbException.get(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论