error.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. const CustomError = require('custom-error-instance')
  2. module.exports = {
  3. AssetFolderExists: CustomError('AssetFolderExists', {
  4. message: 'An asset folder with the same name already exists.',
  5. code: 2001
  6. }),
  7. AuthAccountBanned: CustomError('AuthAccountBanned', {
  8. message: 'Your account has been disabled.',
  9. code: 1016
  10. }),
  11. AuthAccountNotVerified: CustomError('AuthAccountNotVerified', {
  12. message: 'You must verify your account before your can login.',
  13. code: 1017
  14. }),
  15. AuthGenericError: CustomError('AuthGenericError', {
  16. message: 'An unexpected error occured during login.',
  17. code: 1001
  18. }),
  19. AuthLoginFailed: CustomError('AuthLoginFailed', {
  20. message: 'Invalid email / username or password.',
  21. code: 1002
  22. }),
  23. AuthProviderInvalid: CustomError('AuthProviderInvalid', {
  24. message: 'Invalid authentication provider.',
  25. code: 1003
  26. }),
  27. AuthAccountAlreadyExists: CustomError('AuthAccountAlreadyExists', {
  28. message: 'An account already exists using this email address.',
  29. code: 1004
  30. }),
  31. AuthRegistrationDisabled: CustomError('AuthRegistrationDisabled', {
  32. message: 'Registration is disabled. Contact your system administrator.',
  33. code: 1011
  34. }),
  35. AuthRegistrationDomainUnauthorized: CustomError('AuthRegistrationDomainUnauthorized', {
  36. message: 'You are not authorized to register. Must use a whitelisted domain.',
  37. code: 1012
  38. }),
  39. AuthTFAFailed: CustomError('AuthTFAFailed', {
  40. message: 'Incorrect TFA Security Code.',
  41. code: 1005
  42. }),
  43. AuthTFAInvalid: CustomError('AuthTFAInvalid', {
  44. message: 'Invalid TFA Security Code or Login Token.',
  45. code: 1006
  46. }),
  47. AuthValidationTokenInvalid: CustomError('AuthValidationTokenInvalid', {
  48. message: 'Invalid validation token.',
  49. code: 1018
  50. }),
  51. BruteInstanceIsInvalid: CustomError('BruteInstanceIsInvalid', {
  52. message: 'Invalid Brute Force Instance.',
  53. code: 1007
  54. }),
  55. BruteTooManyAttempts: CustomError('BruteTooManyAttempts', {
  56. message: 'Too many attempts! Try again later.',
  57. code: 1008
  58. }),
  59. InputInvalid: CustomError('InputInvalid', {
  60. message: 'Input data is invalid.',
  61. code: 1013
  62. }),
  63. MailNotSetup: CustomError('MailNotSetup', {
  64. message: 'Mail is not setup yet.',
  65. code: 1014
  66. }),
  67. MailTemplateFailed: CustomError('MailTemplateFailed', {
  68. message: 'Mail template failed to load.',
  69. code: 1015
  70. }),
  71. LocaleInvalidNamespace: CustomError('LocaleInvalidNamespace', {
  72. message: 'Invalid locale or namespace.',
  73. code: 1009
  74. }),
  75. SearchActivationFailed: CustomError('SearchActivationFailed', {
  76. message: 'Search Engine activation failed.',
  77. code: 1019
  78. }),
  79. UserCreationFailed: CustomError('UserCreationFailed', {
  80. message: 'An unexpected error occured during user creation.',
  81. code: 1010
  82. })
  83. }