Handle general exceptions in main().