mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 11:35:44 +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;
|
||||
|
||||
public record CoreConfigContextBuilderResult(CoreConfigContext Context, NodeValidatorResult ValidatorResult)
|
||||
|
|
@ -309,6 +311,11 @@ public class CoreConfigContextBuilder
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return nodeValidatorResult;
|
||||
|
|
|
|||
Loading…
Reference in a new issue