Return translation of exception to new class.

        Calling code should only raise exception if exception class is passed
        in, else ``None`` (which signifies no wrapping should be done).

def translate(self, exc):
        """Return translation of exception to new class.

        Calling code should only raise exception if exception class is passed
        in, else ``None`` (which signifies no wrapping should be done).
        """
        # Find actual class.
        for key in self.translations.keys():
            if isinstance(exc, key):
                # pylint: disable=unsubscriptable-object
                return self.translations[key](str(exc))

        return None