Skip to content

Commit 82aea92

Browse files
committed
don’t log errors in subroutines and instead handle at top level
1 parent 3126384 commit 82aea92

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/state.ml

Lines changed: 1 addition & 3 deletions
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 write_to_local_file ~data path with
2020
| Ok () -> Lwt.return @@ Ok ()
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)