Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

EmptyError.ts 643B

12345678910111213141516171819202122232425262728293031
  1. export interface EmptyError extends Error {
  2. }
  3. export interface EmptyErrorCtor {
  4. new(): EmptyError;
  5. }
  6. const EmptyErrorImpl = (() => {
  7. function EmptyErrorImpl(this: any) {
  8. Error.call(this);
  9. this.message = 'no elements in sequence';
  10. this.name = 'EmptyError';
  11. return this;
  12. }
  13. EmptyErrorImpl.prototype = Object.create(Error.prototype);
  14. return EmptyErrorImpl;
  15. })();
  16. /**
  17. * An error thrown when an Observable or a sequence was queried but has no
  18. * elements.
  19. *
  20. * @see {@link first}
  21. * @see {@link last}
  22. * @see {@link single}
  23. *
  24. * @class EmptyError
  25. */
  26. export const EmptyError: EmptyErrorCtor = EmptyErrorImpl as any;