W3C home > Mailing lists > Public > www-talk@w3.org > September to October 2011

Re: Dealing with errors during asynchronous resource creation

From: Mark Nottingham <mnot@mnot.net>
Date: Tue, 13 Sep 2011 16:43:48 +1000
Cc: www-talk@w3.org
Message-Id: <E06D97AE-211C-4A6A-9C49-819C744F3964@mnot.net>
To: Lubomir Rintel <lubo.rintel@gooddata.com>
That's a reasonable start.

Cheers,


On 08/09/2011, at 8:00 PM, Lubomir Rintel wrote:

> Hi Everyone,
> 
> I'm searching for a correct solution (not violating the HTTP protocol
> and causing least possible confusion to client) to this problem:
> 
> I POST a structure with task description to a resource (say /res1) /res1
> triggers creation of a resource, which can take a long time and can
> potentially fail in the end, due problems in task description (user
> fault), that can not be discovered upon the initial POST. I need a way
> to communicate this error to the user in case creation fails or
> resulting resource in case the execution succeeds.
> 
> Would this be correct?
> 
> 1.) Initial POST to /res1 returns an URI /res2
> 2.) Subsequent GET or HEAD of /res2 return 202 until the task finishes
> 3a.) In case the execution succeeds, a GET or HEAD of /res2 returns 200
> with task result as body
> 3b.) Otherwise make the /res2 go away and start returning 410 (or 404?)
> and explaining what went wrong in the body?
> 
> Or is there a better way?
> 
> Thanks,
> -- 
> Lubomir Rintel (GoodData), phone: #7715
> 
> 
> 

--
Mark Nottingham   http://www.mnot.net/
Received on Tuesday, 13 September 2011 06:44:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 13 September 2011 06:44:26 GMT