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.

176 lines
5.9 KiB

5 years ago
5 years ago
5 years ago
  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. PageCreateForbidden: CustomError('PageCreateForbidden', {
  120. message: 'You are not authorized to create this page.',
  121. code: 6008
  122. }),
  123. PageDeleteForbidden: CustomError('PageDeleteForbidden', {
  124. message: 'You are not authorized to delete this page.',
  125. code: 6010
  126. }),
  127. PageGenericError: CustomError('PageGenericError', {
  128. message: 'An unexpected error occured during a page operation.',
  129. code: 6001
  130. }),
  131. PageDuplicateCreate: CustomError('PageDuplicateCreate', {
  132. message: 'Cannot create this page because an entry already exists at the same path.',
  133. code: 6002
  134. }),
  135. PageEmptyContent: CustomError('PageEmptyContent', {
  136. message: 'Page content cannot be empty.',
  137. code: 6004
  138. }),
  139. PageIllegalPath: CustomError('PageIllegalPath', {
  140. message: 'Page path cannot contains illegal characters.',
  141. code: 6005
  142. }),
  143. PageMoveForbidden: CustomError('PageMoveForbidden', {
  144. message: 'You are not authorized to move this page.',
  145. code: 6007
  146. }),
  147. PageNotFound: CustomError('PageNotFound', {
  148. message: 'This page does not exist.',
  149. code: 6003
  150. }),
  151. PagePathCollision: CustomError('PagePathCollision', {
  152. message: 'Destination page path already exists.',
  153. code: 6006
  154. }),
  155. PageUpdateForbidden: CustomError('PageUpdateForbidden', {
  156. message: 'You are not authorized to update this page.',
  157. code: 6009
  158. }),
  159. SearchActivationFailed: CustomError('SearchActivationFailed', {
  160. message: 'Search Engine activation failed.',
  161. code: 4002
  162. }),
  163. SearchGenericError: CustomError('SearchGenericError', {
  164. message: 'An unexpected error occured during search operation.',
  165. code: 4001
  166. }),
  167. UserCreationFailed: CustomError('UserCreationFailed', {
  168. message: 'An unexpected error occured during user creation.',
  169. code: 1009
  170. }),
  171. UserNotFound: CustomError('UserNotFound', {
  172. message: 'This user does not exist.',
  173. code: 1016
  174. })
  175. }