Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

node client does not reject promise on unsucessful request

オープン
#30 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
api, backend

調査の方向性

例で説明されているエントリポイント 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

funcool/httpurr のほかの issue

funcool/httpurr の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。