conprehensiveness check

This commit is contained in:
FineArchs 2024-10-11 15:17:01 +09:00
parent 70bb365cd1
commit fcce5b98b1
2 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
localOnly?: boolean; localOnly?: boolean;
roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][]; roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][];
}, moderator?: MiUser): Promise< }, moderator?: MiUser): Promise<
void undefined
| 'NO_SUCH_EMOJI' | 'NO_SUCH_EMOJI'
| 'SAME_NAME_EMOJI_EXISTS' | 'SAME_NAME_EMOJI_EXISTS'
> { > {
@ -171,6 +171,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
after: updated, after: updated,
}); });
} }
return undefined;
} }
@bindThis @bindThis

View File

@ -98,6 +98,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
case undefined: return; case undefined: return;
case 'NO_SUCH_EMOJI': throw new ApiError(meta.errors.noSuchEmoji); case 'NO_SUCH_EMOJI': throw new ApiError(meta.errors.noSuchEmoji);
case 'SAME_NAME_EMOJI_EXISTS': throw new ApiError(meta.errors.sameNameEmojiExists); case 'SAME_NAME_EMOJI_EXISTS': throw new ApiError(meta.errors.sameNameEmojiExists);
// 網羅性チェック
default: const mustBeNever: never = error;
} }
}); });
} }