Wraps a CLI function to catch errors and handle a graceful exit.
The CLI function to wrap.
The working directory for the CLI function.
Wraps a CLI function to catch errors and handle a graceful exit.