Improved the organization and clarity of error handling in main.py by consolidating exception management and refining error messages, particularly in asynchronous functions.