triton2997 / cowin-slot-notifier

Utility that automatically alerts via email if slots are available on the CoWIN portal. Provides rich filtering by list of pincodes, type of vaccine, dose number, etc
0 stars 0 forks source link

[TASK]: Add exception handling to slot retriever module #27

Closed triton2997 closed 3 years ago

triton2997 commented 3 years ago

Story: #26

Date: 17/07/2021

Description:

  1. Add exception handling for following cases
    • Connection lost (retry)
    • Response other than 200

Task type: Development

Estimated efforts (person hours): 2

Actual efforts (person hours): 1

triton2997 commented 3 years ago
  1. Added exception handling in cowinSlotFinder module
  2. Added except blocks for following error cases - Timeout, Connection lost, HTTP errors(404, 401, etc)
  3. Added except block at the end for handling all other request exceptions (fatal error)
  4. Wrapped all request.get statements in try except blocks
  5. Updated test script and tested for all exception blocks. Tests passed
  6. Added response_code and error variables in main.py. Proper error handling in main module pending

To do:

  1. Move request.get wrapped in try-except to a helper function
triton2997 commented 3 years ago
  1. Moved request.get wrapped in try catch to helper function
  2. Added code in main module to handle errors returned by slot retriever
  3. Full testing of module complete