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.

212 lines
7.2 KiB

5 years ago
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. PageHistoryForbidden: CustomError('PageHistoryForbidden', {
  140. message: 'You are not authorized to view the history of this page.',
  141. code: 6012
  142. }),
  143. PageIllegalPath: CustomError('PageIllegalPath', {
  144. message: 'Page path cannot contains illegal characters.',
  145. code: 6005
  146. }),
  147. PageMoveForbidden: CustomError('PageMoveForbidden', {
  148. message: 'You are not authorized to move this page.',
  149. code: 6007
  150. }),
  151. PageNotFound: CustomError('PageNotFound', {
  152. message: 'This page does not exist.',
  153. code: 6003
  154. }),
  155. PagePathCollision: CustomError('PagePathCollision', {
  156. message: 'Destination page path already exists.',
  157. code: 6006
  158. }),
  159. PageRestoreForbidden: CustomError('PageRestoreForbidden', {
  160. message: 'You are not authorized to restore this page version.',
  161. code: 6011
  162. }),
  163. PageUpdateForbidden: CustomError('PageUpdateForbidden', {
  164. message: 'You are not authorized to update this page.',
  165. code: 6009
  166. }),
  167. PageViewForbidden: CustomError('PageViewForbidden', {
  168. message: 'You are not authorized to view this page.',
  169. code: 6013
  170. }),
  171. SearchActivationFailed: CustomError('SearchActivationFailed', {
  172. message: 'Search Engine activation failed.',
  173. code: 4002
  174. }),
  175. SearchGenericError: CustomError('SearchGenericError', {
  176. message: 'An unexpected error occured during search operation.',
  177. code: 4001
  178. }),
  179. SystemGenericError: CustomError('SystemGenericError', {
  180. message: 'An unexpected error occured.',
  181. code: 7001
  182. }),
  183. SystemSSLDisabled: CustomError('SystemSSLDisabled', {
  184. message: 'SSL is not enabled.',
  185. code: 7002
  186. }),
  187. SystemSSLLEUnavailable: CustomError('SystemSSLLEUnavailable', {
  188. message: 'Let\'s Encrypt is not initialized.',
  189. code: 7004
  190. }),
  191. SystemSSLRenewInvalidProvider: CustomError('SystemSSLRenewInvalidProvider', {
  192. message: 'Current provider does not support SSL certificate renewal.',
  193. code: 7003
  194. }),
  195. UserCreationFailed: CustomError('UserCreationFailed', {
  196. message: 'An unexpected error occured during user creation.',
  197. code: 1009
  198. }),
  199. UserDeleteForeignConstraint: CustomError('UserCreationFailed', {
  200. message: 'Cannot delete user because of content relational constraints.',
  201. code: 1017
  202. }),
  203. UserDeleteProtected: CustomError('UserDeleteProtected', {
  204. message: 'Cannot delete a protected system account.',
  205. code: 1018
  206. }),
  207. UserNotFound: CustomError('UserNotFound', {
  208. message: 'This user does not exist.',
  209. code: 1016
  210. })
  211. }