Skip to content

Commit

Permalink
Print stack in devtool exception warning (#6768)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5b5bd5e)
  • Loading branch information
sophiebits authored and zpao committed Jun 14, 2016
1 parent b3d37a9 commit 9483255
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/isomorphic/ReactDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
handlerDoesThrowForEvent[handlerFunctionName],
'exception thrown by devtool while handling %s: %s',
handlerFunctionName,
e.message
e + '\n' + e.stack
);
handlerDoesThrowForEvent[handlerFunctionName] = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/__tests__/ReactDebugTool-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('ReactDebugTool', function() {
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toContain(
'exception thrown by devtool while handling ' +
'onTestEvent: Hi.'
'onTestEvent: Error: Hi.'
);

ReactDebugTool.onTestEvent();
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/shared/ReactDOMDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
handlerDoesThrowForEvent[handlerFunctionName],
'exception thrown by devtool while handling %s: %s',
handlerFunctionName,
e.message
e + '\n' + e.stack
);
handlerDoesThrowForEvent[handlerFunctionName] = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('ReactDOMDebugTool', function() {
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toContain(
'exception thrown by devtool while handling ' +
'onTestEvent: Hi.'
'onTestEvent: Error: Hi.'
);

ReactDOMDebugTool.onTestEvent();
Expand Down

0 comments on commit 9483255

Please sign in to comment.