-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(shell): satori: use standard error codes
- Loading branch information
Showing
14 changed files
with
190 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: 0401:认证失败 | ||
sidebar_position: 401 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
你配置了 token,或正在使用默认生成的 token,但并未设置认证字段。 | ||
|
||
Chronocat 默认即会开启 API 认证并生成 token。即使你在使用默认设置,也需要设置认证字段以调用 API。 | ||
|
||
如果你设置了认证但仍遇到此问题,最常见的情况是没有前置 `Bearer `。Chronocat Satori API | ||
使用 Bearer 认证法,需要添加的请求头为 `Authorization: Bearer token`。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: 0404:资源不存在 | ||
sidebar_position: 404 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
资源不存在。 | ||
|
||
请求 Satori API 的时候,注意需要加上版本前缀 `/v1/`。 | ||
|
||
如果请求 Satori 资源 API 时出现此问题,请先检查 Chronocat 是否为最新版本。如果 Chronocat | ||
已是最新版本,请通过社区途径寻求帮助。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 0405:不支持的方法 | ||
sidebar_position: 405 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
不支持以这种方法请求。 | ||
|
||
请求 Satori API 时,请使用 POST。 | ||
|
||
请求 Satori 资源 API 时,请使用 GET。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 0500:内部错误 | ||
sidebar_position: 500 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="chronocat" /> | ||
|
||
Chronocat 内部出现了错误。 | ||
|
||
这是 Chronocat 的问题,不过我们尚不清楚问题的具体原因。 | ||
|
||
请通过社区途径寻求帮助。在明确了问题之后,我们会分配该问题的专属错误码。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: 2135:URL 非法 | ||
sidebar_position: 2135 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
HTTP 请求的 URL 非法。 | ||
|
||
这类问题只可能在开发者手写 HTTP 请求时出现。如果你遇到了其他问题,请通过社区途径寻求帮助。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: 2136:资源不存在 | ||
sidebar_position: 2136 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
资源不存在。 | ||
|
||
请求 Satori API 的时候,注意需要加上版本前缀 `/v1/`。 | ||
|
||
如果请求 Satori 资源 API 时出现此问题,请先检查 Chronocat 是否为最新版本。如果 Chronocat | ||
已是最新版本,请通过社区途径寻求帮助。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 2137:不支持的方法 | ||
sidebar_position: 2137 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
不支持以这种方法请求。 | ||
|
||
请求 Satori API 时,请使用 POST。 | ||
|
||
请求 Satori 资源 API 时,请使用 GET。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 2138:内部错误 | ||
sidebar_position: 2138 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="chronocat" /> | ||
|
||
Chronocat 内部出现了错误。 | ||
|
||
这是 Chronocat 的问题,不过我们尚不清楚问题的具体原因。 | ||
|
||
请通过社区途径寻求帮助。在明确了问题之后,我们会分配该问题的专属错误码。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: 2139:认证失败 | ||
sidebar_position: 2139 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
你配置了 token,或正在使用默认生成的 token,但并未设置认证字段。 | ||
|
||
Chronocat 默认即会开启 API 认证并生成 token。即使你在使用默认设置,也需要设置认证字段以调用 API。 | ||
|
||
如果你设置了认证但仍遇到此问题,最常见的情况是没有前置 `Bearer `。Chronocat Satori API | ||
使用 Bearer 认证法,需要添加的请求头为 `Authorization: Bearer token`。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: 2140:资源不存在 | ||
sidebar_position: 2140 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
资源不存在。 | ||
|
||
请求 Satori API 的时候,注意需要加上版本前缀 `/v1/`。 | ||
|
||
如果请求 Satori 资源 API 时出现此问题,请先检查 Chronocat 是否为最新版本。如果 Chronocat | ||
已是最新版本,请通过社区途径寻求帮助。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 2140:不支持的方法 | ||
sidebar_position: 2141 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
不支持以这种方法请求。 | ||
|
||
请求 Satori API 时,请使用 POST。 | ||
|
||
请求 Satori 资源 API 时,请使用 GET。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: 2142:内部错误 | ||
sidebar_position: 2142 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="chronocat" /> | ||
|
||
Chronocat 内部出现了错误。 | ||
|
||
这是 Chronocat 的问题,不过我们尚不清楚问题的具体原因。 | ||
|
||
请通过社区途径寻求帮助。在明确了问题之后,我们会分配该问题的专属错误码。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: 3000:认证失败 | ||
sidebar_position: 3000 | ||
--- | ||
|
||
import { ErrorScope } from '@site/src/components/ErrorScope' | ||
|
||
<ErrorScope scope="dev" /> | ||
|
||
你配置了 token,或正在使用默认生成的 token,但并未设置认证字段。 | ||
|
||
Chronocat 默认即会开启 API 认证并生成 token。即使你在使用默认设置,也需要设置认证字段以调用 API。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters