2
1

server-error-code.enum.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. export const enum ServerErrorCode {
  2. /**
  3. * The simplest form of payload too large: when the file size is over the
  4. * global file size limit
  5. */
  6. MAX_FILE_SIZE_REACHED = 'max_file_size_reached',
  7. /**
  8. * The payload is too large for the user quota set
  9. */
  10. QUOTA_REACHED = 'quota_reached',
  11. /**
  12. * Error yielded upon trying to access a video that is not federated, nor can
  13. * be. This may be due to: remote videos on instances that are not followed by
  14. * yours, and with your instance disallowing unknown instances being accessed.
  15. */
  16. DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 'does_not_respect_follow_constraints',
  17. LIVE_NOT_ENABLED = 'live_not_enabled',
  18. LIVE_NOT_ALLOWING_REPLAY = 'live_not_allowing_replay',
  19. LIVE_CONFLICTING_PERMANENT_AND_SAVE_REPLAY = 'live_conflicting_permanent_and_save_replay',
  20. /**
  21. * Pretty self-explanatory: the set maximum number of simultaneous lives was
  22. * reached, and this error is typically there to inform the user trying to
  23. * broadcast one.
  24. */
  25. MAX_INSTANCE_LIVES_LIMIT_REACHED = 'max_instance_lives_limit_reached',
  26. /**
  27. * Pretty self-explanatory: the set maximum number of simultaneous lives FOR
  28. * THIS USER was reached, and this error is typically there to inform the user
  29. * trying to broadcast one.
  30. */
  31. MAX_USER_LIVES_LIMIT_REACHED = 'max_user_lives_limit_reached',
  32. /**
  33. * A torrent should have at most one correct video file. Any more and we will
  34. * not be able to choose automatically.
  35. */
  36. INCORRECT_FILES_IN_TORRENT = 'incorrect_files_in_torrent',
  37. COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video'
  38. }
  39. /**
  40. * oauthjs/oauth2-server error codes
  41. * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
  42. **/
  43. export const enum OAuth2ErrorCode {
  44. /**
  45. * The provided authorization grant (e.g., authorization code, resource owner
  46. * credentials) or refresh token is invalid, expired, revoked, does not match
  47. * the redirection URI used in the authorization request, or was issued to
  48. * another client.
  49. *
  50. * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-grant-error.js
  51. */
  52. INVALID_GRANT = 'invalid_grant',
  53. /**
  54. * Client authentication failed (e.g., unknown client, no client authentication
  55. * included, or unsupported authentication method).
  56. *
  57. * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-client-error.js
  58. */
  59. INVALID_CLIENT = 'invalid_client',
  60. /**
  61. * The access token provided is expired, revoked, malformed, or invalid for other reasons
  62. *
  63. * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-token-error.js
  64. */
  65. INVALID_TOKEN = 'invalid_token',
  66. }