From 8cd5de7e9848982113abf101bee4697e8a7ec14a Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Tue, 17 Oct 2023 14:19:09 +1100 Subject: [PATCH] Don't catch exceptions for cache items that should exist. --- src/lib/solver.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/solver.ml b/src/lib/solver.ml index 5c06ae8f..c78a938d 100644 --- a/src/lib/solver.ml +++ b/src/lib/solver.ml @@ -125,19 +125,23 @@ module Cache = struct let read track : cache_value option = let fname = fname track in - try + (* try *) let file = open_in (Fpath.to_string fname) in let result = Marshal.from_channel file in close_in file; Some result - with Failure _ | Sys_error _ -> None + (* with Failure _ | Sys_error _ -> None *) end type key = Track.t type t = { successes : Track.t list; failures : Track.t list } let keys t = t.successes -let get key = Cache.read key |> Option.get (* is in cache ? *) |> Result.get_ok +let get key = + (* match Cache.read key with *) + (* | Some v -> v |> Result.get_ok *) + (* | None -> Printf.eprintf "get is None for key %s" Track.pp key *) + Cache.read key |> Option.get (* is in cache ? *) |> Result.get_ok let failures t = t.failures