mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
refactor: use licia uncaught for catching errors
This commit is contained in:
@@ -2555,6 +2555,41 @@ ucs2.decode('abc'); // -> [0x61, 0x62, 0x63]
|
||||
ucs2.decode('𝌆').length; // -> 1
|
||||
```
|
||||
|
||||
## uncaught
|
||||
|
||||
Handle global uncaught errors and promise rejections.
|
||||
|
||||
### start
|
||||
|
||||
Start handling of errors.
|
||||
|
||||
### stop
|
||||
|
||||
Stop handling.
|
||||
|
||||
### addListener
|
||||
|
||||
Add listener for handling errors.
|
||||
|
||||
|Name|Type |Desc |
|
||||
|----|--------|--------------|
|
||||
|fn |function|Error listener|
|
||||
|
||||
### rmListener
|
||||
|
||||
Remove listener.
|
||||
|
||||
### rmAllListeners
|
||||
|
||||
Remove all listeners.
|
||||
|
||||
```javascript
|
||||
uncaught.start();
|
||||
uncaught.addListener(err => {
|
||||
// Do something.
|
||||
});
|
||||
```
|
||||
|
||||
## uniqId
|
||||
|
||||
Generate a globally-unique id.
|
||||
|
||||
Reference in New Issue
Block a user