This project is read-only.
Raising and catching a 'Failure' exception

Category:
Exceptions
Description: How to raise and catch a 'Failure' exception
Code:
let ExceptionSample2() =
try
printfn "About to raise a simple 'Failure' exception..."
failwith "Whoa!"
with
Failure msg ->
printfn "Caught a simple 'Failure' exception, msg = '%s'" msg

Execution Result:
About to raise a simple 'Failure' exception...
Caught a simple 'Failure' exception, msg = 'Whoa!'

Last edited Sep 14, 2011 at 3:43 AM by ttliu2000, version 1

Comments

No comments yet.