diff options
| author | John Estabrook <jestabro@vyos.io> | 2024-10-24 11:04:39 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2024-10-24 11:04:39 -0500 |
| commit | 45c65c695d6df0cb9cd46ef12245b59514b53549 (patch) | |
| tree | c9396df2ece6fe48d848af255e5780b31ab9206c /src | |
| parent | 9ff89e508f81ce71c9073f096fd27c73d4259987 (diff) | |
| download | vyos1x-config-45c65c695d6df0cb9cd46ef12245b59514b53549.tar.gz vyos1x-config-45c65c695d6df0cb9cd46ef12245b59514b53549.zip | |
T6718: catch bad_validator error
Diffstat (limited to 'src')
| -rw-r--r-- | src/value_checker.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/value_checker.ml b/src/value_checker.ml index 06e3dc7..d94f99d 100644 --- a/src/value_checker.ml +++ b/src/value_checker.ml @@ -47,7 +47,9 @@ let validate_any validators constraints value = match constraints with | [] -> true | _ -> - List.exists (fun c -> validate_value validators buf c value) constraints + try + List.exists (fun c -> validate_value validators buf c value) constraints + with Bad_validator e -> let () = Buffer.add_string buf e in false in match validate_exists validators constraints value with | true -> @@ -66,7 +68,9 @@ let validate_all validators constraints value = match constraints with | [] -> true | _ -> - List.for_all (fun c -> validate_value validators buf c value) constraints + try + List.for_all (fun c -> validate_value validators buf c value) constraints + with Bad_validator e -> let () = Buffer.add_string buf e in false in match validate_forall validators constraints value with | true -> |
