Add ability to not throw exception when http status code > 399
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、OpenFeign が HTTP ステータスコード 399 超のレスポンスをどのように処理し、例外がどこで生成されるかを追跡します。呼び出し側が返されたレスポンスを読み続けながら、その動作を無効にする方法を特定します。399 超のステータスコードへの対応を含め、レスポンスエンティティを通じて失敗を処理するクライアント向けに、文書化された利用可能なオプションが存在すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently our team convention is to use response status instead of throwing exception. Say our model is like this:
public class BaseResponse {
private String message;
private int httpStatusCode;
private Boolean isFailed;
private int errorCode;
}
So when our API endpoint failed, we return BaseResponse with failed status instead. Now this is not possible to be read by the client using openfeign since feign will throw exception directly if >399 response status retrieved, so our returned response is useless. We can make our api to return 200 status code instead, but that would violate RESTFUL.
Understand that openfeign is designed to be strictly RESTFUL, but I don't think forcing your user to throw exception is the right thing, because different teams have different convention used on how they handle the failure, and in our case we use our response entity that would describe the failure status.
I appreciate if this feature can be considered, and I will be happy to contribute if needed. Thank you.
- 主要言語
- Java
- スター
- 9.8k
- フォーク
- 2k
- 平均マージ
- 1時間 23分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFeign/feign のほかの issue
-
DefaultAsyncClient never completes the returned future when Client throws Error対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Response.charset ignores charset after another Content-Type parameter対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
UriUtils ignores allowReservedCharacters=false when the input has no percent triplet対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client loses response header value order and duplicate occurrences対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client rejects documented zero connect and read timeouts対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
OpenFeign/feign の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
NationalSecurityAgency/ghidra#10149 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
メンテナーはふだん 1 日以内に返信
-
account bug exercise lecture programming user interface
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ls1intum/Artemis#14512 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
kind:bug priority:major
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
swiftlang/swift-java#955 ·
メンテナーはふだん 1 日以内に返信