Hi everyone ! I was thinking about a little something and wanted to discuss its relevance as the creation of a ticket.
The Http404 exception is a basic exception inheriting from Exception and nothing else :
class Http404(Exception):
pass
I have some pages with multiple get_object_or_404
and no straight forward way to discriminate 404s based on what caused the error.
I wanted to propose the Http404 exception to carry more data, at least the model, when raised. I think it would be relevant for usages such as get_object_or_404
or Paginator.paginate_queryset
.
Once the rich error is raised, besides the handler having more data to so stuff with, I can also easily improve my Sentry’s fingerprinting and monitor more closely what is happing on my application.
Would such a feature be useful to you ? What data besides the model would you have usage for ?
Thank you