Skip to content

Commit 6cb82b2

Browse files
author
Lucas Rebscher
committed
#205 Clean stacktrace only for console log
* We want to keep spans and inline css in errorDetails to have code highlighting in ActionDialog
1 parent 2fe7aa0 commit 6cb82b2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

webapp/Utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const Utils = {
138138
return data
139139
},
140140

141-
cleanStacktrace (stackTrace) {
141+
getPlainStackTrace (stackTrace) {
142142
return stackTrace.replace(/\u001b\[.*?m/g, '');
143143
},
144144

webapp/redux/middleware/middleware.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export default store => next => action => {
3232
next(action);
3333
};
3434

35-
const pythonErrorCallback = error => next(openBackendErrorDialog(error));
35+
const pythonErrorCallback = error => {
36+
console.debug(Utils.getPlainStackTrace(error.errorDetails))
37+
return next(openBackendErrorDialog(error));
38+
};
3639

3740
switch (action.type) {
3841

@@ -163,7 +166,7 @@ export const processError = response => {
163166
if (parsedResponse) {
164167
return {
165168
errorMessage: parsedResponse['message'],
166-
errorDetails: Utils.cleanStacktrace(parsedResponse['details'])
169+
errorDetails: parsedResponse['details']
167170
}
168171
}
169172
return false

0 commit comments

Comments
 (0)