Errors.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* eslint-disable
  2. no-proto,
  3. no-unused-vars,
  4. */
  5. // TODO: This file was created by bulk-decaffeinate.
  6. // Fix any style issues and re-enable lint.
  7. const OError = require('@overleaf/o-error')
  8. let Errors
  9. function NotFoundError(message) {
  10. const error = new Error(message)
  11. error.name = 'NotFoundError'
  12. error.__proto__ = NotFoundError.prototype
  13. return error
  14. }
  15. NotFoundError.prototype.__proto__ = Error.prototype
  16. function FilesOutOfSyncError(message) {
  17. const error = new Error(message)
  18. error.name = 'FilesOutOfSyncError'
  19. error.__proto__ = FilesOutOfSyncError.prototype
  20. return error
  21. }
  22. FilesOutOfSyncError.prototype.__proto__ = Error.prototype
  23. function AlreadyCompilingError(message) {
  24. const error = new Error(message)
  25. error.name = 'AlreadyCompilingError'
  26. error.__proto__ = AlreadyCompilingError.prototype
  27. return error
  28. }
  29. AlreadyCompilingError.prototype.__proto__ = Error.prototype
  30. class QueueLimitReachedError extends OError {}
  31. class TimedOutError extends OError {}
  32. class NoXrefTableError extends OError {}
  33. module.exports = Errors = {
  34. QueueLimitReachedError,
  35. TimedOutError,
  36. NotFoundError,
  37. FilesOutOfSyncError,
  38. AlreadyCompilingError,
  39. NoXrefTableError,
  40. }