Skip to content

Commit 4a403ae

Browse files
committed
Print stack in devtool exception warning
1 parent 92bebca commit 4a403ae

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/isomorphic/ReactDebugTool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
3131
handlerDoesThrowForEvent[handlerFunctionName],
3232
'exception thrown by devtool while handling %s: %s',
3333
handlerFunctionName,
34-
e.message
34+
e + '\n' + e.stack
3535
);
3636
handlerDoesThrowForEvent[handlerFunctionName] = true;
3737
}

src/isomorphic/__tests__/ReactDebugTool-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('ReactDebugTool', function() {
6666
expect(console.error.calls.length).toBe(1);
6767
expect(console.error.argsForCall[0][0]).toContain(
6868
'exception thrown by devtool while handling ' +
69-
'onTestEvent: Hi.'
69+
'onTestEvent: Error: Hi.'
7070
);
7171

7272
ReactDebugTool.onTestEvent();

src/renderers/dom/shared/ReactDOMDebugTool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
3030
handlerDoesThrowForEvent[handlerFunctionName],
3131
'exception thrown by devtool while handling %s: %s',
3232
handlerFunctionName,
33-
e.message
33+
e + '\n' + e.stack
3434
);
3535
handlerDoesThrowForEvent[handlerFunctionName] = true;
3636
}

src/renderers/dom/shared/__tests__/ReactDOMDebugTool-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('ReactDOMDebugTool', function() {
6666
expect(console.error.calls.length).toBe(1);
6767
expect(console.error.argsForCall[0][0]).toContain(
6868
'exception thrown by devtool while handling ' +
69-
'onTestEvent: Hi.'
69+
'onTestEvent: Error: Hi.'
7070
);
7171

7272
ReactDOMDebugTool.onTestEvent();

0 commit comments

Comments
 (0)