getsentry/raven-python — pull request #434 by blueyed (2014-03-18 15:38:37+00:00)
Title: DjangoClient: use fallback in case of ImportError of client

This fixes `AttributeError: 'NoneType' object has no attribute 'split'`
from the WSGI stack, because Sentry itself does not handle internal
exceptions properly.

This makes sure that the DjangoClient is valid, falling back to the
previously used one (in case a temporary client is given/requested), or
to the default client (typically ignoring the wrong user setting).

The ImportError gets logged (with an exception).

I would rather like to not catch the ImportError here, but make Sentry
handle it. On the other hand, it's the responsibility of DjangoClient to
provide a valid client object.

Fixes #433 (https://github.com/getsentry/raven-python/issues/433).