Function safe

Run a function safely and return the result (or the thrown error).