node client does not reject promise on unsucessful request
まだ誰も着手していません。
評価
調査の方向性
例で説明されているエントリポイント node/get と client/send! から始め、成功しなかった HTTP レスポンスの処理を、文書化されている promise の契約と比較します。リクエストのドキュメントを確認し、動作とドキュメントのどちらを変更すべきか判断します。選択したエラー処理のセマンティクスに一貫性があり、文書化されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
(require '[httpurr.client.node :as node])
(require '[promesa.core :as p])
(defn decode
[response]
(update response :body #(js->clj (js/JSON.parse %))))
(defn get!
[url]
(p/then (node/get url) decode))
This is an example from the docs. In contrast to the client/send! function this won't automatically reject the promise if the request failed. Edit, it seems that even when using client/send! and passing the node client a 400 HTTP code does not cause the promise to be rejected. I'm wondering if this should be considered a bug or if using client specific send! functions should be discouraged / removed from the docs?
I find this behavior is probably worth fixing as the documentation describes multiple ways of making requests with different error handling semantics.
From the docs
send!is a function that, given a request map and optionally a map of options, performs the request and returns a promise that will be resolved if there is a response and rejected on timeout, exceptions, HTTP errors or aborts.
- 主要言語
- Clojure
- スター
- 67
- フォーク
- 16
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
funcool/httpurr のほかの issue
-
Outdated doc siteオープン
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
funcool/httpurr の issue をすべて見る
似ている issue
-
難易度 2/5 半日 初心者へのやさしさ 84/100
clojure-lsp/clojure-lsp#2502 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100