[Sugar-devel] Error handling in async js code

Daniel Narvaez dwnarvaez at gmail.com
Sun Jun 2 10:07:28 EDT 2013


I'm sending patches to fix all of these things up in the current code.


On 1 June 2013 13:50, Daniel Narvaez <dwnarvaez at gmail.com> wrote:

> Another couple of related things
>
> * We should always pass an Error object to the callback, not a string.
> * The name of the callback in the functions signature should just be
> "callback".
> * I also think there should only be one callback per function, need to
> change a bit the ds API to avoid multiple callbacks.
>
>
> On 31 May 2013 14:24, Manuel Quiñones <manuq at laptop.org> wrote:
>
>> 2013/5/30 Daniel Narvaez <dwnarvaez at gmail.com>:
>> > Hello,
>> >
>> > in the async API we have written so far we have not been handling errors
>> > very consistently. I think we should just adopt the nodejs convention.
>> The
>> > first parameter passed to all the async callbacks is an error or null
>> if the
>> > call succeeded.
>>
>> I have seen this convention used in other JS projects too, so let's go
>> ahead with it.
>>
>> --
>> .. manuq ..
>>
>
>
>
> --
> Daniel Narvaez
>



-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130602/6d9dadf6/attachment.html>


More information about the Sugar-devel mailing list