Sets a unique error code.
        This method returns reference to this exception to implement Builder pattern to chain additional calls.

        :param code: a unique error code

        :return: this exception object

def with_code(self, code):
        """
        Sets a unique error code.
        This method returns reference to this exception to implement Builder pattern to chain additional calls.

        :param code: a unique error code

        :return: this exception object
        """
        self.code = code if code != None else 'UNKNOWN'
        self.name = code
        return self