Skip to content

Commit 6e31c87

Browse files
committed
✨ feat: export error type
1 parent 5b5455e commit 6e31c87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const PluginErrorType = {
3838

3939
export type IPluginErrorType = (typeof PluginErrorType)[keyof typeof PluginErrorType];
4040

41-
const getStatus = (errorType: IPluginErrorType | string) => {
41+
export const getPluginErrorStatus = (errorType: IPluginErrorType | string) => {
4242
switch (errorType) {
4343
case PluginErrorType.PluginApiNotFound:
4444
case PluginErrorType.PluginMetaNotFound:
@@ -79,7 +79,7 @@ export const createErrorResponse = (
7979
body?: string | object,
8080
): Response => {
8181
// 获取错误类型对应的状态码
82-
const statusCode = getStatus(errorType);
82+
const statusCode = getPluginErrorStatus(errorType);
8383

8484
// 构造错误响应数据
8585
const data: ErrorResponse = { body, errorType };

0 commit comments

Comments
 (0)