From 48fbbbded23c639d8b43eeea7ca91867de37fe7b Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 8 Apr 2019 19:38:42 +0700 Subject: [PATCH] Catch correct exception Signed-off-by: Rudi Grinberg --- src/file_tree.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file_tree.ml b/src/file_tree.ml index a19b46effcd1..3e021f219a27 100644 --- a/src/file_tree.ml +++ b/src/file_tree.ml @@ -185,7 +185,7 @@ type readdir = let readdir path = match Path.readdir_unsorted path with - | exception (Unix.Unix_error (error, _, _)) -> + | exception (Sys_error msg) -> Errors.warn Loc.none "Unable to read directory %a@. Ignoring. \ Remove this message by ignoring by adding:@.\ @@ -195,7 +195,7 @@ let readdir path = Path.pp path (Path.basename path) Path.pp (Path.relative (Path.parent_exn path) "dune") - (Unix.error_message error); + msg; Error error | unsorted_contents -> let files, dirs =