Wraps a "try" block around the function f. If f throws
an exception that is in the domain of the handler PF,
the handler will be invoked on the exception. Otherwise
the exception is wrapped into a Failure.