Skip to content

Commit

Permalink
fix #3290 (catch exception when search file in malformed paths)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysogorskiy Aleksey committed Jul 12, 2018
1 parent 74ac649 commit edde814
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Paket.Core/Common/ProcessHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let tryFindFile dirs file =
let files =
dirs
|> Seq.map (fun (path : string) ->
try
let dir =
DirectoryInfo(
path
Expand All @@ -26,7 +27,13 @@ let tryFindFile dirs file =
else
let fi = FileInfo(Path.Combine(dir.FullName,file))
if fi.Exists then fi.FullName
else "")
else ""
with
| exn ->
Logging.verbosefn "Exception while searching %s in %s:" file path
Logging.verbosefn "%O" exn

"")
|> Seq.filter ((<>) "")
|> Seq.cache
if not (Seq.isEmpty files) then Some(Seq.head files)
Expand Down

0 comments on commit edde814

Please sign in to comment.