1681-engine / index / ErrorDeduper
Class: ErrorDeduper ​
Defined in: src/diagnostics/ErrorDeduper.ts:5
Lets through each distinct error once, and only so many in all: a loop throwing every frame is one report, not sixty a second. Errors are told apart by the first keyLength characters of their message.
Constructors ​
Constructor ​
ts
new ErrorDeduper(max?, keyLength?): ErrorDeduper;Defined in: src/diagnostics/ErrorDeduper.ts:8
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
max | number | 10 |
keyLength | number | 120 |
Returns ​
ErrorDeduper
Methods ​
admit() ​
ts
admit(message): string | null;Defined in: src/diagnostics/ErrorDeduper.ts:14
The key to report under, or null when this error was already let through or the allowance is spent.
Parameters ​
| Parameter | Type |
|---|---|
message | string |
Returns ​
string | null
reset() ​
ts
reset(): void;Defined in: src/diagnostics/ErrorDeduper.ts:22
Forgets what was let through (a new session).
Returns ​
void