Skip to content

Commit

Permalink
i18n(zh-cn): Update error-reference.mdx & reference/errors/ (#10997)
Browse files Browse the repository at this point in the history
* Add `session-config-missing-error.mdx`

* Add `session-config-without-flag-error.mdx`

* Add `session-without-supported-adapter-output-error.mdx`

* Update `error-reference.mdx`

* fix: indent

---------

Co-authored-by: liruifengv <[email protected]>
  • Loading branch information
Nin3lee and liruifengv authored Mar 3, 2025
1 parent 607a813 commit 28dbbc6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/content/docs/zh-cn/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
- [**LocalsNotAnObject**](/zh-cn/reference/errors/locals-not-an-object/)<br/>Value assigned to `locals` is not accepted.
- [**LocalsReassigned**](/zh-cn/reference/errors/locals-reassigned/)<br/>`locals` must not be reassigned.
- [**AstroResponseHeadersReassigned**](/zh-cn/reference/errors/astro-response-headers-reassigned/)<br/>`Astro.response.headers` must not be reassigned.
- [**SessionStorageInitError**](/zh-cn/reference/errors/session-storage-init-error/)<br/>Session storage could not be initialized.
- [**SessionStorageSaveError**](/zh-cn/reference/errors/session-storage-save-error/)<br/>Session data could not be saved.
- [**MiddlewareCantBeLoaded**](/zh-cn/reference/errors/middleware-cant-be-loaded/)<br/>Can't load the middleware.
- [**LocalImageUsedWrongly**](/zh-cn/reference/errors/local-image-used-wrongly/)<br/>Local images must be imported.
- [**AstroGlobUsedOutside**](/zh-cn/reference/errors/astro-glob-used-outside/)<br/>Astro.glob() used outside of an Astro file.
Expand Down Expand Up @@ -128,3 +126,11 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
- [**ActionsReturnedInvalidDataError**](/zh-cn/reference/errors/actions-returned-invalid-data-error/)<br/>Action handler returned invalid data.
- [**ActionNotFoundError**](/zh-cn/reference/errors/action-not-found-error/)<br/>Action not found.
- [**ActionCalledFromServerError**](/zh-cn/reference/errors/action-called-from-server-error/)<br/>Action unexpected called from the server.

## Session(会话)错误

- [**SessionWithoutSupportedAdapterOutputError**](/zh-cn/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
- [**SessionStorageInitError**](/zh-cn/reference/errors/session-storage-init-error/)<br/>Session storage could not be initialized.
- [**SessionStorageSaveError**](/zh-cn/reference/errors/session-storage-save-error/)<br/>Session data could not be saved.
- [**SessionConfigMissingError**](/zh-cn/reference/errors/session-config-missing-error/)<br/>Session storage was enabled but not configured.
- [**SessionConfigWithoutFlagError**](/zh-cn/reference/errors/session-config-without-flag-error/)<br/>Session flag not set
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Session storage was enabled but not configured.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> `experimental.session` 标志被设置为 `true`,但没有配置存储。请要么手动配置存储,要么使用提供会话存储(session storage)的适配器
## 哪里出了问题?
当启用会话存储但却未进行配置时,抛出错误。

**另见:**
- [experimental.session](/zh-cn/reference/experimental-flags/sessions/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Session flag not set
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> 在没有启用 `experimental.session` 标志的前提下提供了会话(session)配置。
## 哪里出了问题?
在没有启用 `experimental.session` 标志却进行了会话存储配置时,抛出错误。

**另见:**
- [experimental.session](/zh-cn/reference/experimental-flags/sessions/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Sessions cannot be used with an adapter that doesn't support server output.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **SessionWithoutSupportedAdapterOutputError**: 会话(session)需要一个支持服务器输出的适配器。该适配器必须在其 `buildOutput` 功能中设置为 `"server"`
## 哪里出了问题?
你的适配器必须支持服务器输出以使用会话。

**另见:**
- [服务器输出适配器构建](/zh-cn/reference/adapter-reference/#构建适配器)

0 comments on commit 28dbbc6

Please sign in to comment.