···9090 Log.warn (fun m -> m "Failed to parse storage response: %s" msg);
9191 None
9292 with Eio.Exn.Io (e, _) ->
9393- Log.warn (fun m -> m "Error fetching key %s: %a" key Eio.Exn.pp_err e);
9494- None)
9393+ let is_key_not_found = match e with
9494+ | Zulip.Error.E err ->
9595+ Zulip.Error.code err = Zulip.Error.Bad_request &&
9696+ String.equal (Zulip.Error.message err) "Key does not exist."
9797+ | _ -> false
9898+ in
9999+ if is_key_not_found then begin
100100+ (* Key not found is a normal case, not an error *)
101101+ Log.debug (fun m -> m "Key not found in storage: %s" key);
102102+ None
103103+ end else begin
104104+ Log.warn (fun m -> m "Error fetching key %s: %a" key Eio.Exn.pp_err e);
105105+ None
106106+ end)
9510796108let set t key value =
97109 Log.debug (fun m -> m "Storing key: %s" key);