title: Override accepted renderer in django-rest-framework on exception
body: <p>I'm using django-rest-framework to create an endpoint which returns a PDF. However, when there is an error rendering the PDF, I want to return a JSON response. But DRF passes the data for the exception to my PDFRenderer class. How can I use JSONRenderer instead, only if there is an error?</p>
  
  <pre><code>class PDFRenderer(BaseRenderer):
      """ DRF renderer for PDF binary content. """
      media_type = 'application/pdf'
      format = 'pdf'
      charset = None
      render_style = 'binary'
  
      def render(self, data, media_type=None, renderer_context=None):
          return bytes(data)
  </code></pre>
  
  <p>For example, when my view says <a href="http://www.django-rest-framework.org/api-guide/exceptions/#permissiondenied" rel="noreferrer"><code>raise PermissionDenied()</code></a>, because the authorized user does not have permission to view the requested PDF, DRF passes <code>{'detail': 'You do not have permission to perform this action.'}</code> as the <code>data</code> argument to <code>PDFRenderer.render</code>. </p>
  
  <p><strong>Edit:</strong> I tried a <a href="http://www.django-rest-framework.org/api-guide/exceptions/#custom-exception-handling" rel="noreferrer">custom exception handler</a> but apparently you still have to run it through DRF's exception handler as well, which passes it to the PDFRenderer.</p>