This class should be derived from pulp.exceptions.PulpException
It should have an http_status_code field of 401
It's missing the data_dict() method

I think fixing this class will fix a lot of the problems you're seeing