Permalink
Browse files

Work on inital module structure

  • Loading branch information...
1 parent 20d6054 commit 02431625a7781836b20bdf41fed3cc1d98a9c021 @3rd-Eden committed Apr 7, 2011
Showing with 59 additions and 7 deletions.
  1. +0 −1 History.md
  2. +0 −1 Makefile
  3. +0 −1 Readme.md
  4. +0 −1 index.js
  5. +59 −3 lib/cluster.exception.js
View
@@ -1,4 +1,3 @@
-
0.0.1 / 2010-01-03
==================
View
@@ -1,4 +1,3 @@
-
test:
@echo "populate me"
View
@@ -1,4 +1,3 @@
-
# cluster.exception
Exception handling for cluster.js
View
@@ -1,2 +1 @@
-
module.exports = require('./lib/cluster.exception');
@@ -1,12 +1,68 @@
-
/*!
* cluster.exception
* Copyright(c) 2011 Arnout Kazemier <info@3rd-Eden.com>
* MIT Licensed
*/
+exports = module.exports = function(options){
+ options = options || {};
+
+ function exception(error, cluster){
+ var details = {
+ environment: {
+ root: process.cwd()
+ , arguments: process.argv
+ , env: process.env
+ , gid: process.getgid()
+ , uid: process.getuid()
+ , pid: process.pid
+ , versions: {
+ node: process.versions.node
+ , v8: process.versions.v8
+ , ares: process.versions.ares
+ , libev: process.versions.ev
+ }
+ }
+ , os: {
+ platform: process.platform
+ , type: os.type()
+ , release: os.release()
+ , hostname: os.hostname()
+ }
+ , stats: {
+ loadaverage: os.loadavg()
+ , cpus: os.cpus()
+ , freemem: os.freemem()
+ , totalmem: os.totalmem()
+ , memory: process.memoryUsage()
+ }
+ , error: {
+ message: error.message
+ , stack: error.stack
+ }
+ , cluster: {
+
+ }
+ };
+ }
+
+ /**
+ *
+ * @param {Cluster} cluster A worker or client instance
+ */
+ function plugin(cluster){
+ // Add a listener to the process
+ process.on("uncaughtException", function(){
+
+ });
+ };
+
+ // Make sure that we also have it called
+ plugin.enableInWorker = true;
+ return plugin;
+};
+
/**
* Library version.
*/
-
-exports.version = '0.0.1';
+exports.version = "0.0.0";

0 comments on commit 0243162

Please sign in to comment.