From 3909baaedcf1ae4ac11b5ada4f640b5d58089dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Fri, 29 Sep 2017 18:43:13 +0200 Subject: [PATCH] Raw_store: document the `Missing_key` error --- src/node/db/raw_store.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/node/db/raw_store.ml b/src/node/db/raw_store.ml index ab0943764..1862277dc 100644 --- a/src/node/db/raw_store.ml +++ b/src/node/db/raw_store.ml @@ -16,6 +16,20 @@ type value = MBytes.t type error += Unknown of string list +let () = + Error_monad.register_error_kind + `Permanent + ~id:"raw_store.unknown" + ~title:"Missing key in store" + ~description:"Missing key in store" + ~pp:(fun ppf keys -> + Format.fprintf ppf + "Missing key in store: %s" + (String.concat "/" keys)) + Data_encoding.(obj1 (req "key" (list string))) + (function Unknown keys -> Some keys | _ -> None) + (fun keys -> Unknown keys) + let concat = String.concat "/" let split = String.split_on_char '/'