How to use the ifError function from assert-plus
Find comprehensive JavaScript assert-plus.ifError code examples handpicked from public code repositorys.
973 974 975 976 977 978 979 980 981 982 983
/** * Like ftw(3) - performs a `find` operation. * * client.ftw('/', function (err, res) { * assert.ifError(err); * * res.on('entry', function (obj) { * console.log(obj); * });
41
75
0
+ 13 other calls in file
121 122 123 124 125 126 127 128 129 130 131
} } exports.setUp = function (callback) { common.setUp(function (err, _client) { assert.ifError(err); assert.ok(_client, 'restify client'); client = _client; callback(); });
20
11
0
383 384 385 386 387 388 389 390 391 392
* client.getUser('admin', function (err, user) { * assert.ifError(err); * * // Note the user object has its own methods * user.listKeys(function (err2, keys) { * assert.ifError(err2); * * keys.forEach(function (k) { * log.debug({ * user: user.login,
9
3
0
+ 3 other calls in file
39 40 41 42 43 44 45 46 47
*/ req.on('end', function collectMetrics() { vasync.parallel({funcs: preCollectFuncs}, function _onPreCollected( preCollectErr ) { assert.ifError( preCollectErr, 'preCollectFuncs should not callback with error' );
3
0
0
assert-plus.object is the most popular function in assert-plus (2295 examples)