Created
January 18, 2016 15:06
-
-
Save AdrieanKhisbe/a637072601b3d36b29b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eraro test | |
var Eraro = require('eraro') | |
var error = Eraro({ | |
package: 'essai' | |
}) | |
var Seneca = require('./seneca') | |
var si = Seneca() | |
si.add('op:a', function (msg, done) { | |
if (msg.a > 12) done(error()) | |
else done(null, {res: msg.a}) | |
}) | |
var a = [1, 3, 14] | |
a.forEach(function (it) { | |
si.act('op:a, a:' + it, function (err, res) { | |
if (err) console.log('ERROR(%d): %j', it, err) | |
else console.log('GOOD(%d): %j', it, res.res) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a before/after modif diff