handle uncaughtException events when using the CLI and exit appropriately