]>
Commit | Line | Data |
---|---|---|
e6abf95e | 1 | export const enum ServerErrorCode { |
c756bae0 RK |
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 | /** | |
9 | * The payload is too large for the user quota set | |
10 | */ | |
11 | QUOTA_REACHED = 'quota_reached', | |
12 | ||
81628e50 RK |
13 | /** |
14 | * Error yielded upon trying to access a video that is not federated, nor can | |
15 | * be. This may be due to: remote videos on instances that are not followed by | |
16 | * yours, and with your instance disallowing unknown instances being accessed. | |
17 | */ | |
18 | DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 'does_not_respect_follow_constraints', | |
19 | ||
c756bae0 RK |
20 | LIVE_NOT_ENABLED = 'live_not_enabled', |
21 | LIVE_NOT_ALLOWING_REPLAY = 'live_not_allowing_replay', | |
22 | LIVE_CONFLICTING_PERMANENT_AND_SAVE_REPLAY = 'live_conflicting_permanent_and_save_replay', | |
81628e50 RK |
23 | /** |
24 | * Pretty self-explanatory: the set maximum number of simultaneous lives was | |
25 | * reached, and this error is typically there to inform the user trying to | |
26 | * broadcast one. | |
27 | */ | |
28 | MAX_INSTANCE_LIVES_LIMIT_REACHED = 'max_instance_lives_limit_reached', | |
81628e50 RK |
29 | /** |
30 | * Pretty self-explanatory: the set maximum number of simultaneous lives FOR | |
31 | * THIS USER was reached, and this error is typically there to inform the user | |
32 | * trying to broadcast one. | |
33 | */ | |
34 | MAX_USER_LIVES_LIMIT_REACHED = 'max_user_lives_limit_reached', | |
35 | ||
36 | /** | |
37 | * A torrent should have at most one correct video file. Any more and we will | |
38 | * not be able to choose automatically. | |
39 | */ | |
5a9a56b7 C |
40 | INCORRECT_FILES_IN_TORRENT = 'incorrect_files_in_torrent', |
41 | ||
e364e31e C |
42 | COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video', |
43 | ||
44 | MISSING_TWO_FACTOR = 'missing_two_factor', | |
45 | INVALID_TWO_FACTOR = 'invalid_two_factor', | |
46 | ||
47 | ACCOUNT_WAITING_FOR_APPROVAL = 'account_waiting_for_approval', | |
0c9668f7 C |
48 | ACCOUNT_APPROVAL_REJECTED = 'account_approval_rejected', |
49 | ||
50 | RUNNER_JOB_NOT_IN_PROCESSING_STATE = 'runner_job_not_in_processing_state', | |
51 | UNKNOWN_RUNNER_TOKEN = 'unknown_runner_token' | |
81628e50 RK |
52 | } |
53 | ||
54 | /** | |
55 | * oauthjs/oauth2-server error codes | |
56 | * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | |
57 | **/ | |
58 | export const enum OAuth2ErrorCode { | |
59 | /** | |
60 | * The provided authorization grant (e.g., authorization code, resource owner | |
61 | * credentials) or refresh token is invalid, expired, revoked, does not match | |
62 | * the redirection URI used in the authorization request, or was issued to | |
63 | * another client. | |
64 | * | |
65 | * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-grant-error.js | |
66 | */ | |
67 | INVALID_GRANT = 'invalid_grant', | |
68 | ||
69 | /** | |
70 | * Client authentication failed (e.g., unknown client, no client authentication | |
71 | * included, or unsupported authentication method). | |
72 | * | |
73 | * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-client-error.js | |
74 | */ | |
e030bfb5 C |
75 | INVALID_CLIENT = 'invalid_client', |
76 | ||
e030bfb5 C |
77 | /** |
78 | * The access token provided is expired, revoked, malformed, or invalid for other reasons | |
79 | * | |
80 | * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-token-error.js | |
81 | */ | |
e364e31e | 82 | INVALID_TOKEN = 'invalid_token' |
e6abf95e | 83 | } |