Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tryCatch.js 442B

1234567891011121314151617181920
  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