JacksonQu / Software-Supply-Chain-Security-Assignment1

GNU General Public License v3.0
0 stars 0 forks source link

Error Handling for calling APIs #4

Open Samkit-shah opened 1 month ago

Samkit-shah commented 1 month ago

https://github.com/JacksonQu/Software-Supply-Chain-Security-Assignment1/blob/d446488fdbda84f8264478efa141aa9ba9dba792/main.py#L8C1-L17C9

It would be better if the code is able to handle failed requests, timeouts, or network-related issues using try - except. This is because there can be possiblity that the API does not response and timesout thus handling that would ensure that the code does not break.

JacksonQu commented 1 month ago

Fixed in branch origin/fix-issue-4