diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-05-09 10:34:22 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-05-12 11:26:41 -0500 |
| commit | 96b559e44783908874a64d19a27cafe532bbee42 (patch) | |
| tree | 2dcf44480e80cbe4208aa231cc88e43fddcace8e | |
| parent | 6292c66b8d281f9d8f6230b1889bbbf3b308746c (diff) | |
| download | vyconf-96b559e44783908874a64d19a27cafe532bbee42.tar.gz vyconf-96b559e44783908874a64d19a27cafe532bbee42.zip | |
T7363: add error indicating uncommited changes
| -rw-r--r-- | data/vyconf.proto | 1 | ||||
| -rw-r--r-- | src/vyconf_pbt.ml | 4 | ||||
| -rw-r--r-- | src/vyconf_pbt.mli | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/data/vyconf.proto b/data/vyconf.proto index 6ad95d8..308bd6b 100644 --- a/data/vyconf.proto +++ b/data/vyconf.proto @@ -188,6 +188,7 @@ enum Errnum { INTERNAL_ERROR = 6; PERMISSION_DENIED = 7; PATH_ALREADY_EXISTS = 8; + UNCOMMITED_CHANGES = 9; } message Response { diff --git a/src/vyconf_pbt.ml b/src/vyconf_pbt.ml index de50dff..55d4438 100644 --- a/src/vyconf_pbt.ml +++ b/src/vyconf_pbt.ml @@ -179,6 +179,7 @@ type errnum = | Internal_error | Permission_denied | Path_already_exists + | Uncommited_changes type response = { status : errnum; @@ -926,6 +927,7 @@ let rec pp_errnum fmt (v:errnum) = | Internal_error -> Format.fprintf fmt "Internal_error" | Permission_denied -> Format.fprintf fmt "Permission_denied" | Path_already_exists -> Format.fprintf fmt "Path_already_exists" + | Uncommited_changes -> Format.fprintf fmt "Uncommited_changes" let rec pp_response fmt (v:response) = let pp_i fmt () = @@ -1334,6 +1336,7 @@ let rec encode_pb_errnum (v:errnum) encoder = | Internal_error -> Pbrt.Encoder.int_as_varint 6 encoder | Permission_denied -> Pbrt.Encoder.int_as_varint 7 encoder | Path_already_exists -> Pbrt.Encoder.int_as_varint 8 encoder + | Uncommited_changes -> Pbrt.Encoder.int_as_varint 9 encoder let rec encode_pb_response (v:response) encoder = encode_pb_errnum v.status encoder; @@ -2089,6 +2092,7 @@ let rec decode_pb_errnum d = | 6 -> (Internal_error:errnum) | 7 -> (Permission_denied:errnum) | 8 -> (Path_already_exists:errnum) + | 9 -> (Uncommited_changes:errnum) | _ -> Pbrt.Decoder.malformed_variant "errnum" let rec decode_pb_response d = diff --git a/src/vyconf_pbt.mli b/src/vyconf_pbt.mli index 907f78c..d7eef26 100644 --- a/src/vyconf_pbt.mli +++ b/src/vyconf_pbt.mli @@ -186,6 +186,7 @@ type errnum = | Internal_error | Permission_denied | Path_already_exists + | Uncommited_changes type response = { status : errnum; |
