Django-Requests-Tracker
Django-Requests-Tracker copied to clipboard
Handle `KeyError` when request details is not existing anymore
Hey!
Currently, if you are on __request__tracker__ and restart the app, request tracker throws unhandled KeyError if you want to go into request details (which is not saved anywhere at this moment)
File "/python3.11/site-packages/requests_tracker/views.py", line 118, in request_details
context = request.request_collectors[UUID(str(request_id))].get_as_context()
│ │ │ └ 'bf1f647d-d71e-4ab9-a23a-b9268ead6e10'
│ │ └ <class 'uuid.UUID'>
│ └ {}
└ <ASGIRequest: GET '/__requests_tracker__/request-details/bf1f647d-d71e-4ab9-a23a-b9268ead6e10'>
KeyError: UUID('bf1f647d-d71e-4ab9-a23a-b9268ead6e10')
Thanks! I'll take a look.