Commits

Yaron Minsky committed 22e6f20

tweaks to error handling

  • Participants
  • Parent commits f746c76

Comments (0)

Files changed (2)

          match Robust_connection.get rconn with
          | None -> printf "%sWaiting for reconnection\n" cstring; return ()
          | Some conn ->
-           try_with (fun () -> Rpc.Rpc.dispatch_exn Protocol.status conn user)
+           Rpc.Rpc.dispatch Protocol.status conn user
            >>| function
            | Error _ ->
              printf "%s%s Unable to reach server\n" cstring (spinner ())
          [ Column.create "category" (fun (c,_,_) -> Category.to_string c)
          ; Column.create "start"    (fun (_,t,_) -> ofday_string t)
          ; Column.create "stop"     (fun (_,_,t) -> ofday_string t)
-         ; Column.create "min"     (fun (_,start,stop) ->
+         ; Column.create "min"      (fun (_,start,stop) ->
            Time.diff stop start
            |> Time.Span.to_min
            |> Float.to_int

File rule_client.ml

            printf "%sFailed!  Will retry.\n\n%s\n" cstring
              (Exn.sexp_of_t err |>  Sexp.to_string_hum))
          (fun () ->
-            try_with (fun () ->
+            try_with ~name:"monitor_violations" (fun () ->
               setup_conn user (fun user conn ->
                 monitor_violations user conn ~stop:(force on_term_signal))))
        |> Deferred.ignore