对算法输入参数非法情况进行过滤
This commit is contained in:
@@ -46,6 +46,19 @@ namespace XplorePlane.Services
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var node = enabledNodes[step];
|
||||
var invalidParameters = node.Parameters
|
||||
.Where(p => !p.IsValueValid)
|
||||
.Select(p => p.DisplayName)
|
||||
.ToList();
|
||||
|
||||
if (invalidParameters.Count > 0)
|
||||
{
|
||||
throw new PipelineExecutionException(
|
||||
$"算子 '{node.DisplayName}' 存在无效参数:{string.Join("、", invalidParameters)}",
|
||||
node.Order,
|
||||
node.OperatorKey);
|
||||
}
|
||||
|
||||
var parameters = node.Parameters
|
||||
.Where(p => p.IsValueValid)
|
||||
.ToDictionary(p => p.Name, p => p.Value);
|
||||
@@ -98,4 +111,4 @@ namespace XplorePlane.Services
|
||||
return scaled;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user