新增表时判断抛出的异常,如果是数据表不存在,则不处理

pull/1/head
hhb 3 months ago
parent 0078a00557
commit bf17f55f41

@ -1 +1 @@
docker build -f ./Dockerfile -t hadoop:1.0.3 ../../.
docker build -f ./Dockerfile -t hadoop:1.0.5 ../../.

@ -166,10 +166,21 @@ namespace ZKLT.Hadoop
/// <returns>是否成功</returns>
public bool InsertTable(HDP_Table table)
{
if (_TableService.GetTable(table.Id) != null)
try
{
throw new ArgumentNullException("表编号已存在");
if (_TableService.GetTable(table.Id) != null)
{
throw new ArgumentNullException("表编号已存在");
}
}
catch (ArgumentNullException e)
{
if (!e.Message.Contains("数据表不存在"))
{
throw;
}
}
if (_TableService.InitStruct("", table))
{
using (TransactionScope _scope = new TransactionScope())

Loading…
Cancel
Save