forked from greim/hoxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhoxy.js
More file actions
26 lines (23 loc) · 647 Bytes
/
Copy pathhoxy.js
File metadata and controls
26 lines (23 loc) · 647 Bytes
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
/*
* Copyright (c) 2014 by Greg Reimer <gregreimer@gmail.com>
* MIT License. See mit-license.txt for more info.
*/
var _ = require('lodash-node');
var Proxy = require('./lib/proxy');
// ---------------------------
module.exports = {
Proxy: Proxy,
forever: function(handler, ctx){
process.on('uncaughtException', function(err){
if (handler === undefined){
console.log(err.stack);
} else if (typeof handler === 'function'){
handler.call(ctx, err);
} else if (typeof handler.write === 'function'){
handler.write(err.stack);
} else {
console.log(err.stack);
}
});
}
};