Skip to content

Commit 0fd8ec4

Browse files
committed
translate 02-sveltekit/06-errors-and-redirects/01-error-basics into Japanese
1 parent 77e4f61 commit 0fd8ec4

File tree

1 file changed

+6
-6
lines changed
  • content/tutorial/02-sveltekit/06-errors-and-redirects/01-error-basics

1 file changed

+6
-6
lines changed

content/tutorial/02-sveltekit/06-errors-and-redirects/01-error-basics/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Basics
33
---
44

5-
There are two types of errors in SvelteKit _expected_ errors and _unexpected_ errors.
5+
SvelteKit には2種類のエラーがあります — _想定される(expected)_ エラーと _予期せぬ(unexpected)_ エラーです。
66

7-
An expected error is one that was created with the [`error`](https://kit.svelte.dev/docs/modules#sveltejs-kit-error) helper from `@sveltejs/kit`, as in `src/routes/expected/+page.server.js`:
7+
想定されるエラーとは、`@sveltejs/kit` からインポートできる [`error`](https://kit.svelte.jp/docs/modules#sveltejs-kit-error) ヘルパーを使用して作成されるエラーのことです。`src/routes/expected/+page.server.js` をご覧ください。
88

99
```js
1010
/// file: src/routes/expected/+page.server.js
@@ -15,7 +15,7 @@ export function load() {
1515
}
1616
```
1717

18-
Any other error — such as the one in `src/routes/unexpected/+page.server.js` — is treated as unexpected:
18+
それ以外のエラー — 例えば `src/routes/unexpected/+page.server.js` にあるようなエラー — は、予期せぬエラーとして扱われます。
1919

2020
```js
2121
/// file: src/routes/unexpected/+page.server.js
@@ -24,8 +24,8 @@ export function load() {
2424
}
2525
```
2626

27-
When you throw an expected error, you're telling SvelteKit 'don't worry, I know what I'm doing here'. An unexpected error, by contrast, is assumed to be a bug in your app. When an unexpected error is thrown, its message and stack trace will be logged to the console.
27+
想定されるエラーをスローすることは、あなたが SvelteKit に '大丈夫、ここで何をやってるかちゃんとわかってるから' と伝えているようなものです。対照的に、予期せぬエラーの場合は、アプリのバグであると考えられます。予期せぬエラーがスローされた場合、そのメッセージとスタックトレースがコンソールにログ出力されるでしょう。
2828

29-
> In a later chapter we'll learn about how to add custom error handling using the `handleError` hook.
29+
> 後の章で、`handleError` hook を使用したカスタムエラーハンドリングの追加方法を学習します。
3030
31-
If you click the links in this app, you'll notice an important difference: the expected error message is shown to the user, whereas the unexpected error message is redacted and replaced with a generic 'Internal Error' message and a 500 status code. That's because error messages can contain sensitive data.
31+
このアプリのリンクをクリックすると、重要な違いに気付くでしょう。想定されるエラーのメッセージはユーザーに表示されますが、予期せぬエラーのメッセージは編集され、一般的な 'Internal Error' メッセージと 500 ステータスコードに置き換えられます。これは、エラーメッセージには機密情報が含まれている可能性があるからです。

0 commit comments

Comments
 (0)