Skip to content

Commit 8730f89

Browse files
committed
don’t log errors in subroutines and instead handle at top level
1 parent 98bf6f2 commit 8730f89

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/state.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ let save state path =
1818
let data = State_j.string_of_state state |> Yojson.Basic.from_string |> Yojson.Basic.pretty_to_string in
1919
match%lwt write_to_local_file ~data path with
2020
| Ok res -> Lwt.return @@ Ok res
21-
| Error e ->
22-
log#error "failed to write to local file %s: %s" path e;
23-
Lwt.return @@ fmt_error "failed to save state"
21+
| Error e -> Lwt.return @@ fmt_error "error while writing to local file %s: %s\nfailed to save state" path e

0 commit comments

Comments
 (0)