Skip to content

Commit 29af7aa

Browse files
committed
keep last 20
1 parent 7e03659 commit 29af7aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/static-webserver/client/source/class/osparc/ConsoleErrorTracker.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ qx.Class.define("osparc.ConsoleErrorTracker", {
3333

3434
// Override console.error
3535
console.error = (...args) => {
36-
// Store the error in the array
37-
this.__errors.push({
36+
this.__errors.unshift({
3837
date: new Date(),
3938
error: args
4039
});
40+
if (this.__errors.length > 20) {
41+
this.__errors.length = 20;
42+
}
4143

4244
// Call the original console.error so the error still appears in the console
4345
originalConsoleError.apply(console, args);

0 commit comments

Comments
 (0)