Skip to content

Commit

Permalink
catch uncaught exceptions in production env
Browse files Browse the repository at this point in the history
  • Loading branch information
minibikini committed Apr 11, 2014
1 parent 6fc9d33 commit 3d9f68d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/AppSpine.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ module.exports = class AppSpine extends EventEmitter2
@init() if @config.initializers?

process.title = @config.appName if @config.appName?
process.on 'uncaughtException', (err) =>
@logger.error 'uncaughtException', err

if @isProduction()
process.on 'uncaughtException', (err) =>
@logger.error 'uncaughtException', err

getEnvironment: ->
@config.env or process.env.NODE_ENV or 'development'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appspine",
"version": "0.0.7",
"version": "0.0.8",
"description": "node.js application namespace base class",
"keywords": [
"application",
Expand Down

0 comments on commit 3d9f68d

Please sign in to comment.