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.

244 lines
8.3 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. AuthPasswordInvalid: CustomError('AuthPasswordInvalid', {
  60. message: 'Password is incorrect.',
  61. code: 1020
  62. }),
  63. AuthProviderInvalid: CustomError('AuthProviderInvalid', {
  64. message: 'Invalid authentication provider.',
  65. code: 1003
  66. }),
  67. AuthRegistrationDisabled: CustomError('AuthRegistrationDisabled', {
  68. message: 'Registration is disabled. Contact your system administrator.',
  69. code: 1010
  70. }),
  71. AuthRegistrationDomainUnauthorized: CustomError('AuthRegistrationDomainUnauthorized', {
  72. message: 'You are not authorized to register. Your domain is not whitelisted.',
  73. code: 1011
  74. }),
  75. AuthRequired: CustomError('AuthRequired', {
  76. message: 'You must be authenticated to access this resource.',
  77. code: 1019
  78. }),
  79. AuthTFAFailed: CustomError('AuthTFAFailed', {
  80. message: 'Incorrect TFA Security Code.',
  81. code: 1005
  82. }),
  83. AuthTFAInvalid: CustomError('AuthTFAInvalid', {
  84. message: 'Invalid TFA Security Code or Login Token.',
  85. code: 1006
  86. }),
  87. AuthValidationTokenInvalid: CustomError('AuthValidationTokenInvalid', {
  88. message: 'Invalid validation token.',
  89. code: 1015
  90. }),
  91. BruteInstanceIsInvalid: CustomError('BruteInstanceIsInvalid', {
  92. message: 'Invalid Brute Force Instance.',
  93. code: 1007
  94. }),
  95. BruteTooManyAttempts: CustomError('BruteTooManyAttempts', {
  96. message: 'Too many attempts! Try again later.',
  97. code: 1008
  98. }),
  99. CommentContentMissing: CustomError('CommentContentMissing', {
  100. message: 'Comment content is missing or too short.',
  101. code: 8003
  102. }),
  103. CommentGenericError: CustomError('CommentGenericError', {
  104. message: 'An unexpected error occured.',
  105. code: 8001
  106. }),
  107. CommentManageForbidden: CustomError('CommentManageForbidden', {
  108. message: 'You are not authorized to manage comments on this page.',
  109. code: 8004
  110. }),
  111. CommentNotFound: CustomError('CommentNotFound', {
  112. message: 'This comment does not exist.',
  113. code: 8005
  114. }),
  115. CommentPostForbidden: CustomError('CommentPostForbidden', {
  116. message: 'You are not authorized to post a comment on this page.',
  117. code: 8002
  118. }),
  119. CommentViewForbidden: CustomError('CommentViewForbidden', {
  120. message: 'You are not authorized to view comments for this page.',
  121. code: 8006
  122. }),
  123. InputInvalid: CustomError('InputInvalid', {
  124. message: 'Input data is invalid.',
  125. code: 1012
  126. }),
  127. LocaleGenericError: CustomError('LocaleGenericError', {
  128. message: 'An unexpected error occured during locale operation.',
  129. code: 5001
  130. }),
  131. LocaleInvalidNamespace: CustomError('LocaleInvalidNamespace', {
  132. message: 'Invalid locale or namespace.',
  133. code: 5002
  134. }),
  135. MailGenericError: CustomError('MailGenericError', {
  136. message: 'An unexpected error occured during mail operation.',
  137. code: 3001
  138. }),
  139. MailInvalidRecipient: CustomError('MailInvalidRecipient', {
  140. message: 'The recipient email address is invalid.',
  141. code: 3004
  142. }),
  143. MailNotConfigured: CustomError('MailNotConfigured', {
  144. message: 'The mail configuration is incomplete or invalid.',
  145. code: 3002
  146. }),
  147. MailTemplateFailed: CustomError('MailTemplateFailed', {
  148. message: 'Mail template failed to load.',
  149. code: 3003
  150. }),
  151. PageCreateForbidden: CustomError('PageCreateForbidden', {
  152. message: 'You are not authorized to create this page.',
  153. code: 6008
  154. }),
  155. PageDeleteForbidden: CustomError('PageDeleteForbidden', {
  156. message: 'You are not authorized to delete this page.',
  157. code: 6010
  158. }),
  159. PageGenericError: CustomError('PageGenericError', {
  160. message: 'An unexpected error occured during a page operation.',
  161. code: 6001
  162. }),
  163. PageDuplicateCreate: CustomError('PageDuplicateCreate', {
  164. message: 'Cannot create this page because an entry already exists at the same path.',
  165. code: 6002
  166. }),
  167. PageEmptyContent: CustomError('PageEmptyContent', {
  168. message: 'Page content cannot be empty.',
  169. code: 6004
  170. }),
  171. PageHistoryForbidden: CustomError('PageHistoryForbidden', {
  172. message: 'You are not authorized to view the history of this page.',
  173. code: 6012
  174. }),
  175. PageIllegalPath: CustomError('PageIllegalPath', {
  176. message: 'Page path cannot contains illegal characters.',
  177. code: 6005
  178. }),
  179. PageMoveForbidden: CustomError('PageMoveForbidden', {
  180. message: 'You are not authorized to move this page.',
  181. code: 6007
  182. }),
  183. PageNotFound: CustomError('PageNotFound', {
  184. message: 'This page does not exist.',
  185. code: 6003
  186. }),
  187. PagePathCollision: CustomError('PagePathCollision', {
  188. message: 'Destination page path already exists.',
  189. code: 6006
  190. }),
  191. PageRestoreForbidden: CustomError('PageRestoreForbidden', {
  192. message: 'You are not authorized to restore this page version.',
  193. code: 6011
  194. }),
  195. PageUpdateForbidden: CustomError('PageUpdateForbidden', {
  196. message: 'You are not authorized to update this page.',
  197. code: 6009
  198. }),
  199. PageViewForbidden: CustomError('PageViewForbidden', {
  200. message: 'You are not authorized to view this page.',
  201. code: 6013
  202. }),
  203. SearchActivationFailed: CustomError('SearchActivationFailed', {
  204. message: 'Search Engine activation failed.',
  205. code: 4002
  206. }),
  207. SearchGenericError: CustomError('SearchGenericError', {
  208. message: 'An unexpected error occured during search operation.',
  209. code: 4001
  210. }),
  211. SystemGenericError: CustomError('SystemGenericError', {
  212. message: 'An unexpected error occured.',
  213. code: 7001
  214. }),
  215. SystemSSLDisabled: CustomError('SystemSSLDisabled', {
  216. message: 'SSL is not enabled.',
  217. code: 7002
  218. }),
  219. SystemSSLLEUnavailable: CustomError('SystemSSLLEUnavailable', {
  220. message: 'Let\'s Encrypt is not initialized.',
  221. code: 7004
  222. }),
  223. SystemSSLRenewInvalidProvider: CustomError('SystemSSLRenewInvalidProvider', {
  224. message: 'Current provider does not support SSL certificate renewal.',
  225. code: 7003
  226. }),
  227. UserCreationFailed: CustomError('UserCreationFailed', {
  228. message: 'An unexpected error occured during user creation.',
  229. code: 1009
  230. }),
  231. UserDeleteForeignConstraint: CustomError('UserDeleteForeignConstraint', {
  232. message: 'Cannot delete user because of content relational constraints.',
  233. code: 1017
  234. }),
  235. UserDeleteProtected: CustomError('UserDeleteProtected', {
  236. message: 'Cannot delete a protected system account.',
  237. code: 1018
  238. }),
  239. UserNotFound: CustomError('UserNotFound', {
  240. message: 'This user does not exist.',
  241. code: 1016
  242. })
  243. }