As clearly as possible, describe the changes made in the pull request. You should at least detail "what changes have been made" and "what the results of these changes will be".
This pull request adds error handling to the script that generates average CO2 emissions data for each country. The changes made are as follows:
Added a try-catch block around the fetch request to handle network errors and log appropriate messages
Ensured that necessary directories (data/output and src/data) are created before attempting to write files to prevent runtime errors
These changes improve the robustness and reliability of the script, making it more resilient to failures and easier to debug for developers
Triage
Type of change
Please select any of the below items that are appropriate.
This pull request:
Related issue/s
Please list below any issues this pull request is related to.
Docs changes required
Do any changes made in this pull request require parts of the CO2.js documentation to be updated?
If you answered "Yes", please create an corresponding issue in our Developer Documentation repository.
Describe the changes made in this pull request
As clearly as possible, describe the changes made in the pull request. You should at least detail "what changes have been made" and "what the results of these changes will be".
This pull request adds error handling to the script that generates average CO2 emissions data for each country. The changes made are as follows: