require('./lib/js.io/packages/jsio')
jsio.path.shared = './js'
jsio.path.server = './js'

var redis = require('./lib/redis-node-client/lib/redis-client')
var sys = require('sys')

jsio('from shared.javascript import bind')
jsio('import shared.query')

shared.query.init(redis)

process.addListener('exit', shared.query.release)
process.addListener('uncaughtException', function(e) {
	sys.puts("ERROR: uncaught exception", JSON.stringify(e))
	process.exit()
})
process.addListener('SIGINT', process.exit)
require('./lib/js.io/packages/jsio')
jsio.path.shared = './js'
jsio.path.server = './js'

var redis = require('./lib/redis-node-client/lib/redis-client')
var sys = require('sys')

jsio('from shared.javascript import bind')
jsio('import shared.query')

shared.query.init(redis)

process.addListener('exit', shared.query.release)
process.addListener('uncaughtException', function(e) {
	try {
		sys.puts("ERROR: uncaught exception", JSON.stringify(e))
	} catch(e2) {
		sys.puts("ERROR: could not JSON stringify error message", e.message, e2.message)
	}
	process.exit()
})
process.addListener('SIGINT', process.exit)
Add a second layer of try/catch around the error reporting, in case the JSON stringification of the error object fails due to circular references
Add a second layer of try/catch around the error reporting, in case the JSON stringification of the error object fails due to circular references
