index.js
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Generated by CoffeeScript 1.7.1
(function() {
var exports, iferr, printerr, throwerr, tiferr,
__slice = [].slice;
iferr = function(fail, succ) {
return function() {
var a, err;
err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (err != null) {
return fail(err);
} else {
return typeof succ === "function" ? succ.apply(null, a) : void 0;
}
};
};
tiferr = function(fail, succ) {
return iferr(fail, function() {
var a, err;
a = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
try {
return succ.apply(null, a);
} catch (_error) {
err = _error;
return fail(err);
}
});
};
throwerr = iferr.bind(null, function(err) {
throw err;
});
printerr = iferr(function(err) {
return console.error(err.stack || err);
});
module.exports = exports = iferr;
exports.iferr = iferr;
exports.tiferr = tiferr;
exports.throwerr = throwerr;
exports.printerr = printerr;
}).call(this);