Last Updated: February 25, 2016
·
479
· thanpolas

Always ground your exposed callbacks

Always ground the callbacks that your API is exposing. If the consumer throws an exception, it will bubble up to your stack preventing further execution.

// ground callback exceptions
try{callback(true);}catch(ex){}

// ... or this part will never be reached
defer.resolve(true);

1 Response
Add your response

over 1 year ago ·