refactor(exceptions): MinimaxRequestError is a subclass of MinimaxAPIError, conflating two error categories
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
調査の方向性
minimax_mcp/exceptions.py から始めて現在の例外階層を確認し、その後 minimax_mcp/server.py の MinimaxAPIError ハンドラーを確認します。issue で説明されている中立的なベースアプローチを選択し、API と request の異なるカテゴリを維持したうえで、既存の PR #87 のテストが意図した例外動作で引き続きパスすることを検証します。
索引モデルが issue の本文から書いたものです。
説明
Summary
In minimax_mcp/exceptions.py:
class MinimaxAPIError(Exception):
"""Base exception for Minimax API errors."""
pass
class MinimaxRequestError(MinimaxAPIError):
"""Request related errors."""
pass
MinimaxRequestError is a subclass of MinimaxAPIError, but the two represent different error categories:
MinimaxAPIError— problems talking to the remote API (auth, network, 5xx, etc.). Worth retrying.MinimaxRequestError— client-side problems (missing required field, bad combination, etc.). Never worth retrying.
Because of the inheritance, every except MinimaxAPIError block in minimax_mcp/server.py also catches MinimaxRequestError. This makes it impossible for callers to handle "transient" vs "permanent" failures differently — and it complicates retry logic, metrics, and error budgets.
Impact
- All tool functions return the same generic error message format for both transient and permanent failures, even though clients might want to retry one and not the other.
- The PR #87 test suite had to be written around the inheritance — e.g.
with pytest.raises(MinimaxRequestError)works, but a hypotheticaltry/except MinimaxAPIError: retry()would also catchMinimaxRequestError, which is the wrong behavior.
Suggested fix
Two options, in order of preference:
- Make them siblings under
MinimaxError(rename the current base toMinimaxErroror add a new neutral base). BothMinimaxAPIErrorandMinimaxRequestErrorshould be siblings, not parent/child. - At minimum, update existing
except MinimaxAPIError as e:blocks toexcept (MinimaxAPIError, MinimaxRequestError) as e:(orexcept MinimaxError as e:after the refactor) and document the categories in each tool's docstring.
Option 1 is cleaner and a one-file change.
Discovered via
Issue filed as a follow-up to PR #87 (test coverage). Tests pass either way, but the inheritance makes the error-handling story confusing for new contributors.
🤖 Generated with Claude Code
- 主要言語
- Python
- スター
- 1.6k
- フォーク
- 284
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MiniMax-AI/MiniMax-MCP のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
MiniMax-AI/MiniMax-MCP#88 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
MiniMax-AI/MiniMax-MCP#78 ·
-
fix(server): music_generation has inconsistent indentation — try block indented inside function body オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
MiniMax-AI/MiniMax-MCP#69 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
MiniMax-AI/MiniMax-MCP#105 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
MiniMax-AI/MiniMax-MCP#103 ·
MiniMax-AI/MiniMax-MCP の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100