emacs-devel
[Top][All Lists]
Advanced

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

Re: more url-utils?


From: Stefan Monnier
Subject: Re: more url-utils?
Date: Thu, 19 May 2011 10:28:05 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>> 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

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


        Stefan



reply via email to

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