Skip to content

Commit

Permalink
エラーをthrowするようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
sigprogramming committed Nov 5, 2024
1 parent 4badcb1 commit 9e19a09
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/store/singing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,7 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
const phrase = getOrThrow(state.phrases, context.phraseKey);
const phraseQueryKey = phrase.queryKey;
if (phraseQueryKey != undefined) {
mutations.DELETE_PHRASE_QUERY({ queryKey: phraseQueryKey });
throw new Error("The previous query has not been removed.");
}
mutations.SET_PHRASE_QUERY({ queryKey, query });
mutations.SET_QUERY_KEY_TO_PHRASE({
Expand Down Expand Up @@ -2027,9 +2027,7 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
const phrase = getOrThrow(state.phrases, context.phraseKey);
const phraseSingingPitchKey = phrase.singingPitchKey;
if (phraseSingingPitchKey != undefined) {
mutations.DELETE_PHRASE_SINGING_PITCH({
singingPitchKey: phraseSingingPitchKey,
});
throw new Error("The previous singing pitch has not been removed.");
}
mutations.SET_PHRASE_SINGING_PITCH({ singingPitchKey, singingPitch });
mutations.SET_SINGING_PITCH_KEY_TO_PHRASE({
Expand Down Expand Up @@ -2160,9 +2158,9 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
const phrase = getOrThrow(state.phrases, context.phraseKey);
const phraseSingingVolumeKey = phrase.singingVolumeKey;
if (phraseSingingVolumeKey != undefined) {
mutations.DELETE_PHRASE_SINGING_VOLUME({
singingVolumeKey: phraseSingingVolumeKey,
});
throw new Error(
"The previous singing volume has not been removed.",
);
}
mutations.SET_PHRASE_SINGING_VOLUME({
singingVolumeKey,
Expand Down Expand Up @@ -2285,7 +2283,7 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
const phrase = getOrThrow(state.phrases, context.phraseKey);
const phraseSingingVoiceKey = phrase.singingVoiceKey;
if (phraseSingingVoiceKey != undefined) {
phraseSingingVoices.delete(phraseSingingVoiceKey);
throw new Error("The previous singing voice has not been removed.");
}
phraseSingingVoices.set(singingVoiceKey, singingVoice);
mutations.SET_SINGING_VOICE_KEY_TO_PHRASE({
Expand Down

0 comments on commit 9e19a09

Please sign in to comment.