Skip to content

Conversation

@ukwhatn
Copy link
Owner

@ukwhatn ukwhatn commented Jan 2, 2026

概要

ネットワークエラー(接続切断、チャンク読み取り失敗等)発生時にリトライを行うように修正。

問題

現状、以下のエラーが発生した場合にリトライされず即座に失敗していた:

peer closed connection without sending complete message body (incomplete chunked read)

これは httpx.RemoteProtocolError として発生するが、現在は httpx.HTTPStatusErrorhttpx.TimeoutException のみをキャッチしていた。

修正内容

  • httpx.RequestError をキャッチするように変更
    • これにより TimeoutException, ConnectError, ReadError, RemoteProtocolError 等すべてのリクエストエラーでリトライされる
  • Wikidotサーバーのエラー率が高いことをコメントに記載
  • エラーメッセージを改善: ネットワークエラーの場合は実際のエラー内容を表示

- httpx.RequestErrorをキャッチするように変更(TimeoutException, RemoteProtocolError等を含む)
- Wikidotサーバーのエラー率が高いことをコメントに記載
- エラーメッセージを改善: ネットワークエラーの場合は実際のエラー内容を表示
@ukwhatn ukwhatn merged commit 58bcca2 into main Jan 2, 2026
13 checks passed
@ukwhatn ukwhatn deleted the fix/transport-error-retry branch January 2, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants