F# How to catch all exceptions

Viewed 4042

I know how to catch specific exceptions as in the following example:

let test_zip_archive candidate_zip_archive =
  let rc =
      try
        ZipFile.Open(candidate_zip_archive.ToString(), ZipArchiveMode.Read) |> ignore
      zip_file_ok
      with
      | :? System.IO.InvalidDataException -> not_a_zip_file
      | :? System.IO.FileNotFoundException -> file_not_found         
      | :? System.NotSupportedException -> unsupported_exception
  rc

I am reading a bunch of articles to see if I can use a generic exception in the with, like a wildcard match. Does such a construct exist, and, if so, what is it?

2 Answers
Related