def find_message_handler(self, handler_name, handler_type='primary'):
        """Returns the MessageHandler given its name and type for this class."""
        ret = lib.EnvFindDefmessageHandler(
            self._env, self._cls, handler_name.encode(), handler_type.encode())
        if ret == 0:
            raise CLIPSError(self._env)

        return MessageHandler(self._env, self._cls, ret)