runtime error trying to deserialise non json responses

未關閉
#480 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
api

研究方向

從 Python API 用戶端的回應處理著手,並將其行為與連結的 retryDecision.ts JavaScript 邏輯進行比較。驗證對於逾時、網路錯誤,以及既不是 2xx 也不是 4xx 的狀態,response.json() 會被跳過;當這些情況不再引發反序列化例外時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Bug

The Python API client throws a runtime exception while attempting to desialize a non json response. Note that, as described on the JavaScript API Client, we should NOT deserialise responses on those cases:

isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4)

Source: https://github.com/algolia/algoliasearch-client-javascript/blob/master/packages/transporter/src/concerns/retryDecision.ts#L12.

Solution: Create a pull request that ensures that no response.json() is performed on the cases mentioned above.

主要語言
Python
星號
207
分支
63
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

algolia/algoliasearch-client-python 的其他 Issue

查看 algolia/algoliasearch-client-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。