You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.1 KiB

  1. const CustomError = require('custom-error-instance')
  2. module.exports = {
  3. AssetDeleteForbidden: CustomError('AssetDeleteForbidden', {
  4. message: 'You are not authorized to delete this asset.',
  5. code: 2003
  6. }),
  7. AssetFolderExists: CustomError('AssetFolderExists', {
  8. message: 'An asset folder with the same name already exists.',
  9. code: 2002
  10. }),
  11. AssetGenericError: CustomError('AssetGenericError', {
  12. message: 'An unexpected error occured during asset operation.',
  13. code: 2001
  14. }),
  15. AssetInvalid: CustomError('AssetInvalid', {
  16. message: 'This asset does not exist or is invalid.',
  17. code: 2004
  18. }),
  19. AssetRenameCollision: CustomError('AssetRenameCollision', {
  20. message: 'An asset with the same filename in the same folder already exists.',
  21. code: 2005
  22. }),
  23. AssetRenameForbidden: CustomError('AssetRenameForbidden', {
  24. message: 'You are not authorized to rename this asset.',
  25. code: 2006
  26. }),
  27. AssetRenameInvalid: CustomError('AssetRenameInvalid', {
  28. message: 'The new asset filename is invalid.',
  29. code: 2007
  30. }),
  31. AssetRenameInvalidExt: CustomError('AssetRenameInvalidExt', {
  32. message: 'The file extension cannot be changed on an existing asset.',
  33. code: 2008
  34. }),
  35. AssetRenameTargetForbidden: CustomError('AssetRenameTargetForbidden', {
  36. message: 'You are not authorized to rename this asset to the requested name.',
  37. code: 2009
  38. }),
  39. AuthAccountBanned: CustomError('AuthAccountBanned', {
  40. message: 'Your account has been disabled.',
  41. code: 1013
  42. }),
  43. AuthAccountAlreadyExists: CustomError('AuthAccountAlreadyExists', {
  44. message: 'An account already exists using this email address.',
  45. code: 1004
  46. }),
  47. AuthAccountNotVerified: CustomError('AuthAccountNotVerified', {
  48. message: 'You must verify your account before your can login.',
  49. code: 1014
  50. }),
  51. AuthGenericError: CustomError('AuthGenericError', {
  52. message: 'An unexpected error occured during login.',
  53. code: 1001
  54. }),
  55. AuthLoginFailed: CustomError('AuthLoginFailed', {
  56. message: 'Invalid email / username or password.',
  57. code: 1002
  58. }),
  59. AuthProviderInvalid: CustomError('AuthProviderInvalid', {
  60. message: 'Invalid authentication provider.',
  61. code: 1003
  62. }),
  63. AuthRegistrationDisabled: CustomError('AuthRegistrationDisabled', {
  64. message: 'Registration is disabled. Contact your system administrator.',
  65. code: 1010
  66. }),
  67. AuthRegistrationDomainUnauthorized: CustomError('AuthRegistrationDomainUnauthorized', {
  68. message: 'You are not authorized to register. Your domain is not whitelisted.',
  69. code: 1011
  70. }),
  71. AuthTFAFailed: CustomError('AuthTFAFailed', {
  72. message: 'Incorrect TFA Security Code.',
  73. code: 1005
  74. }),
  75. AuthTFAInvalid: CustomError('AuthTFAInvalid', {
  76. message: 'Invalid TFA Security Code or Login Token.',
  77. code: 1006
  78. }),
  79. AuthValidationTokenInvalid: CustomError('AuthValidationTokenInvalid', {
  80. message: 'Invalid validation token.',
  81. code: 1015
  82. }),
  83. BruteInstanceIsInvalid: CustomError('BruteInstanceIsInvalid', {
  84. message: 'Invalid Brute Force Instance.',
  85. code: 1007
  86. }),
  87. BruteTooManyAttempts: CustomError('BruteTooManyAttempts', {
  88. message: 'Too many attempts! Try again later.',
  89. code: 1008
  90. }),
  91. InputInvalid: CustomError('InputInvalid', {
  92. message: 'Input data is invalid.',
  93. code: 1012
  94. }),
  95. LocaleGenericError: CustomError('LocaleGenericError', {
  96. message: 'An unexpected error occured during locale operation.',
  97. code: 5001
  98. }),
  99. LocaleInvalidNamespace: CustomError('LocaleInvalidNamespace', {
  100. message: 'Invalid locale or namespace.',
  101. code: 5002
  102. }),
  103. MailGenericError: CustomError('MailGenericError', {
  104. message: 'An unexpected error occured during mail operation.',
  105. code: 3001
  106. }),
  107. MailInvalidRecipient: CustomError('MailInvalidRecipient', {
  108. message: 'The recipient email address is invalid.',
  109. code: 3004
  110. }),
  111. MailNotConfigured: CustomError('MailNotConfigured', {
  112. message: 'The mail configuration is incomplete or invalid.',
  113. code: 3002
  114. }),
  115. MailTemplateFailed: CustomError('MailTemplateFailed', {
  116. message: 'Mail template failed to load.',
  117. code: 3003
  118. }),
  119. PageGenericError: CustomError('PageGenericError', {
  120. message: 'An unexpected error occured during a page operation.',
  121. code: 6001
  122. }),
  123. PageDuplicateCreate: CustomError('PageDuplicateCreate', {
  124. message: 'Cannot create this page because an entry already exists at the same path.',
  125. code: 6002
  126. }),
  127. PageEmptyContent: CustomError('PageEmptyContent', {
  128. message: 'Page content cannot be empty.',
  129. code: 6004
  130. }),
  131. PageNotFound: CustomError('PageNotFound', {
  132. message: 'This page does not exist.',
  133. code: 6003
  134. }),
  135. SearchActivationFailed: CustomError('SearchActivationFailed', {
  136. message: 'Search Engine activation failed.',
  137. code: 4002
  138. }),
  139. SearchGenericError: CustomError('SearchGenericError', {
  140. message: 'An unexpected error occured during search operation.',
  141. code: 4001
  142. }),
  143. UserCreationFailed: CustomError('UserCreationFailed', {
  144. message: 'An unexpected error occured during user creation.',
  145. code: 1009
  146. }),
  147. UserNotFound: CustomError('UserNotFound', {
  148. message: 'This user does not exist.',
  149. code: 1016
  150. })
  151. }