Convert Exception class to a Python dictionary.

def to_dict(self):
        """Convert Exception class to a Python dictionary."""
        val = dict(self.payload or ())
        if self.message:
            val['message'] = self.message
        return val