[Sugar-devel] Error handling in async js code

Daniel Narvaez dwnarvaez at gmail.com
Sat Jun 1 07:50:35 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130601/d9e16095/attachment.html>


More information about the Sugar-devel mailing list