[PR #341] refactor: 提取 getErrorType/getGeminiStatus 为模块级共享函数 #343

Open
opened 2026-02-27 07:19:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/341
Author: @lly835
Created: 2/26/2026
Status: 🔄 Open

Base: mainHead: fix/deduplicate-error-helpers


📝 Commits (1)

  • 8bff6f6 refactor: 提取 getErrorType/getGeminiStatus 为模块级共享函数

📊 Changes

1 file changed (+28 additions, -40 deletions)

View changed files

📝 src/utils/common.js (+28 -40)

📄 Description

将 createErrorResponse 和 createStreamErrorResponse 中重复定义的 getErrorType 和 getGeminiStatus 辅助函数提取为模块级函数,消除代码重复。

  • 减少 40 行重复代码
  • 无功能变更

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/justlovemaki/AIClient-2-API/pull/341 **Author:** [@lly835](https://github.com/lly835) **Created:** 2/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/deduplicate-error-helpers` --- ### 📝 Commits (1) - [`8bff6f6`](https://github.com/justlovemaki/AIClient-2-API/commit/8bff6f67931e8c2d73b5fe25b5509efbc9ab5356) refactor: 提取 getErrorType/getGeminiStatus 为模块级共享函数 ### 📊 Changes **1 file changed** (+28 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/utils/common.js` (+28 -40) </details> ### 📄 Description 将 createErrorResponse 和 createStreamErrorResponse 中重复定义的 getErrorType 和 getGeminiStatus 辅助函数提取为模块级函数,消除代码重复。 - 减少 40 行重复代码 - 无功能变更 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#343
No description provided.