title: How to properly return error when overriding .get_queryset()?
body: <p>I read on DRF doc that you can filter againt query parameters by overriding .get_queryset(). I am looking for the best practice, on what to return, in case the filters are incorrect and where to return an error message.</p>
  
  <p>The doc I referred to is <a href="https://www.django-rest-framework.org/api-guide/filtering/#filtering-against-query-parameters" rel="nofollow noreferrer">here</a> 
  And I include the source code below </p>
  
  <pre><code>class PurchaseList(generics.ListAPIView):
      serializer_class = PurchaseSerializer
  
      def get_queryset(self):
          """
          Optionally restricts the returned purchases to a given user,
          by filtering against a `username` query parameter in the URL.
          """
          queryset = Purchase.objects.all()
          username = self.request.query_params.get('username', None)
          if username is not None:
              queryset = queryset.filter(purchaser__username=username)
          return queryset
  </code></pre>
  
  <p>Thank you for your help</p>