fix(backend): アンテナ等がポリシーで定められた上限を超えている場合、変更や追加ができないように (MisskeyIO#646)
This commit is contained in:
parent
5ff34d2f8f
commit
2b2975c0dd
17 changed files with 281 additions and 19 deletions
|
@ -25,6 +25,18 @@ export const meta = {
|
|||
code: 'NO_SUCH_CLIP',
|
||||
id: 'b4d92d70-b216-46fa-9a3f-a8c811699257',
|
||||
},
|
||||
|
||||
clipLimitExceeded: {
|
||||
message: 'You cannot update the clip because you have exceeded the limit of clips.',
|
||||
code: 'CLIP_LIMIT_EXCEEDED',
|
||||
id: 'fed46dd9-d99a-4a88-b23f-8d31c80b5b25',
|
||||
},
|
||||
|
||||
clipNotesLimitExceeded: {
|
||||
message: 'You cannot update the clip because you have exceeded the limit of notes in a clip.',
|
||||
code: 'CLIP_NOTES_LIMIT_EXCEEDED',
|
||||
id: '6f02ab37-66a4-4285-afaf-a8b1000e8f3f',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
|
@ -58,6 +70,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
} catch (e) {
|
||||
if (e instanceof ClipService.NoSuchClipError) {
|
||||
throw new ApiError(meta.errors.noSuchClip);
|
||||
} else if (e instanceof ClipService.ClipLimitExceededError) {
|
||||
throw new ApiError(meta.errors.clipLimitExceeded);
|
||||
} else if (e instanceof ClipService.ClipNotesLimitExceededError) {
|
||||
throw new ApiError(meta.errors.clipNotesLimitExceeded);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue