Skip to content

Commit

Permalink
improv: allow to disable context retrivable on error
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Aug 3, 2018
1 parent d2a8d0f commit 0368559
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ let cst = {

UNIQUE_SERVER_ID: getUniqueId(),

ENABLE_CONTEXT_ON_ERROR: useIfDefined(process.env.PM2_AGENT_ENABLE_CONTEXT_ON_ERROR, true),

SUCCESS_EXIT: 0,
ERROR_EXIT: 1
}
Expand Down
2 changes: 1 addition & 1 deletion src/push/PushInteractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = class PushInteractor {
}

// attach additional info for exception
if (event === 'process:exception') {
if (event === 'process:exception' && cst.ENABLE_CONTEXT_ON_ERROR === true) {
packet.data.last_logs = this.log_buffer[packet.process.name]
packet.data = this._stackParser.attachContext(packet.data)
}
Expand Down

0 comments on commit 0368559

Please sign in to comment.