diff --git a/src/lib_shell/block_directory.ml b/src/lib_shell/block_directory.ml index 6009c3df0..66f1cad51 100644 --- a/src/lib_shell/block_directory.ml +++ b/src/lib_shell/block_directory.ml @@ -166,7 +166,7 @@ let build_raw_rpc_directory register1 S.Context.read begin fun block path q () -> let depth = Option.unopt ~default:max_int q#depth in fail_unless (depth >= 0) - (Tezos_shell_services.Block_services.Invalid_depth_arg (path, depth)) >>=? fun () -> + (Tezos_shell_services.Block_services.Invalid_depth_arg depth) >>=? fun () -> State.Block.context block >>= fun context -> Context.mem context path >>= fun mem -> Context.dir_mem context path >>= fun dir_mem -> diff --git a/src/lib_shell_services/block_services.ml b/src/lib_shell_services/block_services.ml index 4288f6b87..24f771bb8 100644 --- a/src/lib_shell_services/block_services.ml +++ b/src/lib_shell_services/block_services.ml @@ -126,19 +126,19 @@ let raw_context_encoding = ]) type error += - | Invalid_depth_arg of (string list * int) + | Invalid_depth_arg of int let () = register_error_kind `Permanent - ~id:"raw_context.missing_key" - ~title:"...FIXME..." - ~description:"...FIXME..." - ~pp:(fun ppf path -> - Format.fprintf ppf "Missing key: %s" (String.concat "/" path)) - Data_encoding.(obj1 (req "path" (list string))) - (function Missing_key path -> Some path | _ -> None) - (fun path -> Missing_key path) + ~id:"raw_context.invalid_depth" + ~title:"Invalid depth argument" + ~description:"The raw context extraction depth argument must be positive." + ~pp:(fun ppf depth -> + Format.fprintf ppf "Extraction depth %d is invalid" depth) + Data_encoding.(obj1 (req "depth" int31)) + (function Invalid_depth_arg depth -> Some depth | _ -> None) + (fun depth -> Invalid_depth_arg depth) module type PROTO = sig val hash: Protocol_hash.t diff --git a/src/lib_shell_services/block_services.mli b/src/lib_shell_services/block_services.mli index e7302e2ee..e60493245 100644 --- a/src/lib_shell_services/block_services.mli +++ b/src/lib_shell_services/block_services.mli @@ -46,7 +46,7 @@ type raw_context = val pp_raw_context: Format.formatter -> raw_context -> unit type error += - | Invalid_depth_arg of (string list * int) + | Invalid_depth_arg of int module type PROTO = sig val hash: Protocol_hash.t