In F#, you can create a user-defined exception. It provides flexibility to define custom exceptions according to requirement.
Example :
let ExExample a b =
let mutable c = 0
try
c <- (a/b)
with
| :? System.DivideByZeroException as e -> printfn "%s" e.Message
printfn "Rest of the code"
ExExample 10 0