A functional wrapper for the classic try/catch statement in JavaScript.