mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 19:45:45 +00:00
Report node validator result (#9025)
This commit is contained in:
parent
e19b000081
commit
70003e8a81
1 changed files with 7 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace ServiceLib.Handler.Builder;
|
namespace ServiceLib.Handler.Builder;
|
||||||
|
|
||||||
public record CoreConfigContextBuilderResult(CoreConfigContext Context, NodeValidatorResult ValidatorResult)
|
public record CoreConfigContextBuilderResult(CoreConfigContext Context, NodeValidatorResult ValidatorResult)
|
||||||
|
|
@ -309,6 +311,11 @@ public class CoreConfigContextBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
var nodeValidatorResult = NodeValidator.Validate(node, context.RunCoreType);
|
var nodeValidatorResult = NodeValidator.Validate(node, context.RunCoreType);
|
||||||
|
var msgs = new List<string>([.. nodeValidatorResult.Errors, .. nodeValidatorResult.Warnings]);
|
||||||
|
if (msgs.Count > 0)
|
||||||
|
{
|
||||||
|
Logging.SaveLog($"{node.Remarks}: {string.Join("; ", msgs)}");
|
||||||
|
}
|
||||||
if (!nodeValidatorResult.Success)
|
if (!nodeValidatorResult.Success)
|
||||||
{
|
{
|
||||||
return nodeValidatorResult;
|
return nodeValidatorResult;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue