error.ts 455 B

1234567891011121314151617181920212223
  1. /** @public */
  2. export class BSONError extends Error {
  3. constructor(message: string) {
  4. super(message);
  5. Object.setPrototypeOf(this, BSONError.prototype);
  6. }
  7. get name(): string {
  8. return 'BSONError';
  9. }
  10. }
  11. /** @public */
  12. export class BSONTypeError extends TypeError {
  13. constructor(message: string) {
  14. super(message);
  15. Object.setPrototypeOf(this, BSONTypeError.prototype);
  16. }
  17. get name(): string {
  18. return 'BSONTypeError';
  19. }
  20. }