baseError.ts 630 B

123456789101112
  1. /**
  2. * @ignore
  3. * Application error to support additional information when loading a file
  4. */
  5. export abstract class BaseError extends Error {
  6. // See https://stackoverflow.com/questions/12915412/how-do-i-extend-a-host-object-e-g-error-in-typescript
  7. // and https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
  8. // Polyfill for Object.setPrototypeOf if necessary.
  9. protected static _setPrototypeOf: (o: any, proto: object | null) => any =
  10. (Object as any).setPrototypeOf || ((o, proto) => { o.__proto__ = proto; return o; });
  11. }