Skip to content

Commit 2a60ada

Browse files
Merge pull request #227 from study-basic-hackathon/fix/translate-api-error-messages-to-ja
API が返すエラーメッセージを日本語に翻訳
2 parents dd365e9 + 726cdd6 commit 2a60ada

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

client/src/api/arranger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function getArranger(
99
const path = endpoint("/arrangers/{arrangerId}").replace("{arrangerId}", String(arrangerId));
1010
const response = await fetch(path);
1111
if (!response.ok) {
12-
throw new Error(`Failed to fetch arranger with ID ${arrangerId}`);
12+
throw new Error(`作者ID ${arrangerId} の情報取得に失敗しました。`);
1313
}
1414
return response.json();
1515
}
@@ -25,7 +25,7 @@ export async function getArrangerWorkListItems(
2525
);
2626
const response = await fetch(path);
2727
if (!response.ok) {
28-
throw new Error(`Failed to fetch works for arranger with ID ${arrangerId}`);
28+
throw new Error(`作者ID ${arrangerId} の作品一覧取得に失敗しました。`);
2929
}
3030

3131
return response.json();
@@ -42,7 +42,7 @@ export async function getArrangerWorkListItem(
4242
.replace("{workId}", String(workId));
4343
const response = await fetch(path);
4444
if (!response.ok) {
45-
throw new Error(`Failed to fetch work with ID ${workId} for arranger with ID ${arrangerId}`);
45+
throw new Error(`作者ID ${arrangerId} の作品ID ${workId} の情報取得に失敗しました。`);
4646
}
4747
return response.json();
4848
}

client/src/api/category.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function getCategory(
99
const path = endpoint("/categories/{categoryId}").replace("{categoryId}", String(categoryId));
1010
const response = await fetch(path);
1111
if (!response.ok) {
12-
throw new Error(`Failed to fetch category with ID ${categoryId}`);
12+
throw new Error(`カテゴリID ${categoryId} の情報取得に失敗しました。`);
1313
}
1414
return response.json();
1515
}
@@ -25,7 +25,7 @@ export async function getCategoryWorkListItems(
2525
);
2626
const response = await fetch(path);
2727
if (!response.ok) {
28-
throw new Error(`Failed to fetch works for category with ID ${categoryId}`);
28+
throw new Error(`カテゴリID ${categoryId} の作品一覧取得に失敗しました。`);
2929
}
3030
return response.json();
3131
}
@@ -41,7 +41,7 @@ export async function getCategoryWorkListItem(
4141
.replace("{workId}", String(workId));
4242
const response = await fetch(path);
4343
if (!response.ok) {
44-
throw new Error(`Failed to fetch work with ID ${workId} for category with ID ${categoryId}`);
44+
throw new Error(`カテゴリID ${categoryId} の作品ID ${workId} の情報取得に失敗しました。`);
4545
}
4646
return response.json();
4747
}

client/src/api/exhibition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function getExhibition(
2222
);
2323
const response = await fetch(path);
2424
if (!response.ok) {
25-
throw new Error(`華展ID ${exhibitionId} の華展情報取得に失敗しました。`);
25+
throw new Error(`華展ID ${exhibitionId} の情報取得に失敗しました。`);
2626
}
2727
return response.json();
2828
}
@@ -54,7 +54,7 @@ export async function getExhibitionWorkListItem(
5454
.replace("{workId}", String(workId));
5555
const response = await fetch(path);
5656
if (!response.ok) {
57-
throw new Error(`華展ID ${exhibitionId} の作品ID ${workId} の取得に失敗しました。`);
57+
throw new Error(`華展ID ${exhibitionId} の作品ID ${workId} の情報取得に失敗しました。`);
5858
}
5959
return response.json();
6060
}

client/src/api/material.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function getMaterial(
99
const path = endpoint("/materials/{materialId}").replace("{materialId}", String(materialId));
1010
const response = await fetch(path);
1111
if (!response.ok) {
12-
throw new Error(`Failed to fetch material with ID ${materialId}`);
12+
throw new Error(`花材ID ${materialId} の情報取得に失敗しました。`);
1313
}
1414
return response.json();
1515
}
@@ -25,7 +25,7 @@ export async function getMaterialWorkListItems(
2525
);
2626
const response = await fetch(path);
2727
if (!response.ok) {
28-
throw new Error(`Failed to fetch works for material with ID ${materialId}`);
28+
throw new Error(`花材ID ${materialId} の作品一覧取得に失敗しました。`);
2929
}
3030
return response.json();
3131
}
@@ -41,7 +41,7 @@ export async function getMaterialWorkListItem(
4141
.replace("{workId}", String(workId));
4242
const response = await fetch(path);
4343
if (!response.ok) {
44-
throw new Error(`Failed to fetch work with ID ${workId} for material with ID ${materialId}`);
44+
throw new Error(`花材ID ${materialId} の作品ID ${workId} の情報取得に失敗しました。`);
4545
}
4646
return response.json();
4747
}

client/src/api/season.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export async function getSeason(
77
const path = endpoint("/seasons/{seasonId}").replace("{seasonId}", String(seasonId));
88
const response = await fetch(path);
99
if (!response.ok) {
10-
throw new Error(`Failed to fetch season with ID ${seasonId}`);
10+
throw new Error(`季節ID ${seasonId} の情報取得に失敗しました。`);
1111
}
1212
return response.json();
1313
}
@@ -20,7 +20,7 @@ export async function getSeasonWorkListItems(
2020
const path = endpoint("/seasons/{seasonId}/works").replace("{seasonId}", String(seasonId));
2121
const response = await fetch(path);
2222
if (!response.ok) {
23-
throw new Error(`Failed to fetch works for season with ID ${seasonId}`);
23+
throw new Error(`季節ID ${seasonId} の作品一覧取得に失敗しました。`);
2424
}
2525
return response.json();
2626
}
@@ -36,7 +36,7 @@ export async function getSeasonWorkListItem(
3636
.replace("{workId}", String(workId));
3737
const response = await fetch(path);
3838
if (!response.ok) {
39-
throw new Error(`Failed to fetch work with ID ${workId} for season with ID ${seasonId}`);
39+
throw new Error(`季節ID ${seasonId} の作品ID ${workId} の情報取得に失敗しました。`);
4040
}
4141
return response.json();
4242
}

0 commit comments

Comments
 (0)