Skip to content

Commit eb7fd4a

Browse files
committed
improved error handling
1 parent 56ebe4a commit eb7fd4a

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

lib/components/TopPanel/TopPanel.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,6 @@ var TopPanel = (function (_super) {
5252
this.props.pageSet(index);
5353
this.props.editorMarkdownOpen(title, index);
5454
};
55-
TopPanel.prototype.componentWillMount = function () {
56-
this.startErrorLog();
57-
};
58-
TopPanel.prototype.startErrorLog = function () {
59-
window.onerror = function (message, file, line, column, errorObject) {
60-
column = column || (window.event && window.event.errorCharacter);
61-
var stack = errorObject ? errorObject.stack : null;
62-
var data = {
63-
message: message,
64-
file: file,
65-
line: line,
66-
column: column,
67-
errorStack: stack,
68-
};
69-
return false;
70-
};
71-
};
7255
TopPanel = __decorate([
7356
react_redux_1.connect(function (state) { return ({
7457
tutorial: state.tutorial,

src/components/TopPanel/TopPanel.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,4 @@ export default class TopPanel extends React.Component<{
6262
this.props.pageSet(index);
6363
this.props.editorMarkdownOpen(title, index);
6464
}
65-
private componentWillMount() {
66-
this.startErrorLog();
67-
}
68-
private startErrorLog() {
69-
window.onerror = (message, file, line, column, errorObject) => {
70-
column = column || (window.event && window.event.errorCharacter);
71-
const stack = errorObject ? errorObject.stack : null;
72-
73-
const data = {
74-
message,
75-
file,
76-
line,
77-
column,
78-
errorStack: stack,
79-
};
80-
81-
// call to server
82-
return false;
83-
};
84-
}
8565
}

0 commit comments

Comments
 (0)