[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more url-utils?

From: Ted Zlatanov
Subject: Re: more url-utils?
Date: Thu, 19 May 2011 08:35:44 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

On Thu, 19 May 2011 10:28:05 -0300 Stefan Monnier <address@hidden> wrote: 

>>>> OK.  But if the status is nil we couldn't get any data so there are no
>>>> URL properties.  So we can have just one callback parameter "url-info"
>>>> which is nil if the request failed and an alist if it worked.

SM> I think that a boolean status is not sufficient.  E.g. in case of
SM> failure, we want to have some information about why (e.g. an error
SM> message).

>> ..but we don't want to throw an error.  Hrm.  How about "url-info" is
>> three possible types:

>> 1) nil = failed, no information available (should happen only if there's
>> no handler for the URL's protocol)

>> 2) atom (string or symbol) = failed, information is the string or the
>> symbol's properties

SM> How 'bout: the result of url-fetch (either returned in passed to the
SM> callback), is list of the form (STATUS . INFO): if STATUS is nil, it
SM> means the call was a success and INFO is an alist of auxiliary info such
SM> as headers and stuff, and if STATUS is non-nil, it should be an error
SM> symbol and INFO is some failure information such that one can do
SM> (signal (car result) (cdr result)).

Sure, that's a nice solution.  I'll use that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]