Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
442 bytes
|
Line | |
---|
1 | import { errorObject } from './errorObject';
|
---|
2 | let tryCatchTarget;
|
---|
3 | function tryCatcher() {
|
---|
4 | errorObject.e = undefined;
|
---|
5 | try {
|
---|
6 | return tryCatchTarget.apply(this, arguments);
|
---|
7 | }
|
---|
8 | catch (e) {
|
---|
9 | errorObject.e = e;
|
---|
10 | return errorObject;
|
---|
11 | }
|
---|
12 | finally {
|
---|
13 | tryCatchTarget = undefined;
|
---|
14 | }
|
---|
15 | }
|
---|
16 | export function tryCatch(fn) {
|
---|
17 | tryCatchTarget = fn;
|
---|
18 | return tryCatcher;
|
---|
19 | }
|
---|
20 | //# sourceMappingURL=tryCatch.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.