Skip to content

Commit

Permalink
Catch exceptions in tryFindReferencesInFile
Browse files Browse the repository at this point in the history
Co-authored-by: Jimmy Byrd <[email protected]>
  • Loading branch information
Booksbaum and TheAngryByrd committed Feb 15, 2023
1 parent a9a43d6 commit fb26aa2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,13 @@ module Commands =
dict.TryAdd(file, ranges) |> ignore
return Ok()
}
|> Async.Catch
|> Async.map(Result.ofChoice >> Result.mapError string >> Result.bind id)
|> Async.map (fun x ->
match x with
| Ok () -> ()
| Error e ->
commandsLogger.info (Log.setMessage "OnFound failed: {error}" >> Log.addContextDestructured "error" e))
commandsLogger.info (Log.setMessage "tryFindReferencesInFile failed: {error}" >> Log.addContextDestructured "error" e))

let iterProject (project: FSharpProjectOptions) =
asyncResult {
Expand Down

0 comments on commit fb26aa2

Please sign in to comment.