Developer Guide Menu

Global 0.4.4

Type Definitions

callback(erropt, nullable, dataopt, nullable) > {void}
Microform uses the error-first callback pattern, as commonly used in  Node.js .
If an error occurs, it is returned by the first 
err
 argument of the callback. If no error occurs, 
err
 has a null value and any return data is provided in the second argument.
Parameters
Name
Type
Attributes
Description
err
MicroformError (see  Class: MicroformInstance 0.4.4 )
An Object detailing occurred errors, otherwise null.
data
*
In success scenarios, this is whatever data has been returned by the asynchronous function call, if any.
Returns
Type: void
Examples
The following example shows how to make use of this style of error handling in your code:
             
foo(function (err, data) { // check for and handle any errors if (err) throw err; // otherwise use the data returned console.log(data); });
Top