File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -378,17 +378,26 @@ end = struct
378378 (fun () -> Csexp_rpc. connect sock sockaddr)
379379 in
380380 match session with
381- | Error exns ->
381+ | Error exns -> (
382382 Lev_fiber.Fd. close sock;
383- let message =
384- let exn = List. hd exns in
385- Format. asprintf " unable to connect to dune %s@.%a"
386- (Registry.Dune. root source)
387- Exn_with_backtrace. pp_uncaught exn
388- in
389- let + () = t.config.log ~type_: Error ~message in
390- t.state < - Finished ;
391- Error ()
383+ match
384+ List. filter exns ~f: (fun exn ->
385+ match exn with
386+ | { Exn_with_backtrace. exn = Unix. Unix_error (ECONNREFUSED , _, _)
387+ ; _
388+ } -> false
389+ | _ -> true )
390+ with
391+ | [] -> Fiber. return (Error () )
392+ | exn :: _ ->
393+ let message =
394+ Format. asprintf " unable to connect to dune %s@.%a"
395+ (Registry.Dune. root source)
396+ Exn_with_backtrace. pp_uncaught exn
397+ in
398+ let + () = t.config.log ~type_: Error ~message in
399+ t.state < - Finished ;
400+ Error () )
392401 | Ok session ->
393402 t.state < - Connected (session, where);
394403 Fiber. return (Ok () )
You can’t perform that action at this time.
0 commit comments