GatorEducator / execexam

:rocket: ExecExam runs executable examinations that assess Python programming skills
https://pypi.org/project/execexam/
1 stars 3 forks source link

feat: Add Error Handling for Missing Internet Connection #20

Closed hemanialaparthi closed 5 days ago

hemanialaparthi commented 5 days ago
  1. Pull Request: Add Error Handling for Missing Internet Connection and ensure CodingMentor doesn't crash.

  2. List the names of those who contributed to the project. @hemanialaparthi

  3. Link the issue the pull request is meant to fix/resolve. Closes #15

  4. Describe the contents and goal of the pull request.

This PR adds a feature that improves how the program handles situations where there is no internet connection. Previously, the program would crash if the Litellm dependency couldn't connect to the internet. Now, the program checks for an internet connection before running. If no connection is found, the user receives a message asking them to check their network, preventing the program from crashing and making it more reliable in offline situations.

  1. Will coverge be maintained/increased? Yes, coverage will be increased for the advice module, as I have implemented new tests to ensure the new feature is fully tested.

  2. What operating systems has this been tested on? How were these tests conducted? The tests have been conducted on a mac. It would be great if I could have a Linux and Windows user test it out.

  3. Include a code block and/or screenshots displaying the functionality of your feature, if applicable/possible.

    When the coding mentor is run without internet this should be included in the output:

Error: Unable to connect to the API server.
Please check your network connection and ensure the API server is reachable.

If internet connection is present, the program will continue and no additional output is produced.

Mark as a draft until it is ready to begin the reviewing process and then tag Gregory Kapfhammer when you mark it as ready for review.