W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1999

[Fwd: Returned mail: User unknown]

From: Doug Simon <dougxc@uq.net.au>
Date: Tue, 26 Oct 1999 15:57:41 +1000
Message-ID: <381542D5.50B30515@uq.net.au>
To: www-lib@w3.org
  I am not sure if this is the forum for libwww newbies so please
ignore this if it is.

I am trying to use libwww to do a simple retrieval of a file via
either http or ftp. This is in essence a configuration file for a
certain part of the network app I am developing. The address of
the config file is given by the user. I can use libwww to verify
that the address is well formed within the restraints I impose.
However, I want to be able to use the error handling part of
HTRequest to return an intelligent message when the file cannot
be retrieved for some reason. I cannot figure out how this is
done. Here is a representative code sample of what I have at the

	HTProfile_newNoCacheClient ("GetRSS", "1.0");

	 * Setup the request.
	HTRequest* request = HTRequest_new();
	HTList* errors = HTList_new();
	HTRequest_setError(request, errors);

	boolean pre_emptive = HTRequest_preemptive(request);

	HTRequest_setOutputFormat(request, WWW_SOURCE);

	HTChunk* chunk = HTLoadToChunk(_sourceURL, request);

	if (!HTList_isEmpty(errors))
--->		printf("We have errors!!");

	if (!chunk)
		fprintf(stderr,"error retrieving RSS file");
	char* data = HTChunk_toCString(chunk);
	if (data) {
		_rssContents = String(data,False);
		fprintf(stderr,"RSS file is empty!!");
	 * Clean up

When the URL is well formed and the file is available, everything
goes fine. However, when either of the above conditions fails,
the line marked ---> is never reached? Why is that? Is there some
good documentation/examples of how to catch these errors?


Received on Tuesday, 26 October 1999 02:02:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:52 UTC