dataProvider delete method only throw Internal Server Error message for errors
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
調査の方向性
dataProvider の削除パスと、コンソールスタックに示されている fetchHydra.js および HttpError.js の場所から始めます。削除時のエラーハンドリングを PUT、POST、GET のパスと比較し、hydra:description を含む HTTP エラーレスポンスによって、汎用的な内部サーバーエラーではなくそのメッセージが生成されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
API Platform Admin version(s) affected: 3.4.5
Description
Using the useDelete hook, APIP-Admin only throw an 'Internal Server Error' error, even if the API return an error message.
For example, on the API side I have this:
throw new EntityDeleteForeignKeyException(
$this->translator->trans(
'error.entity.my_entity.delete.has_foreign_key',
[
'%my_entity%' => $item->value,
'%entity_linked%' => $this->translator->trans('entity.my_other_entity'),
]
)
);
This code return a 409 http status code, with the following body:
"@context": "/contexts/Error"
"@type": "hydra:Error"
"hydra:description": "My Error Message"
"hydra:title": "An error occurred"
Wich is at this point the intended behavior so there is no problem.
But then, on the admin side, when we delete the entity and we get a 409 response (in fact, no matter the status code, the result is the same for every HTTP errors), the APIP-admin dataProvider thrown an internal server error and does not take the hydra:description like it do with other methods (PUT, POST, GET...).
This is what is shown in the console when this occurs:
Error
at new HttpError (HttpError.js:33:23)
at eval (fetchHydra.js:53:39)
Aditionnal Context:
- If I remember well, the same type of error happens a while back, when the delete method return a 204 status (maybe it is linked to this https://github.com/api-platform/admin/issues/440)
- This may be a duplicate of this issue: https://github.com/api-platform/admin/issues/381, but as there where no activity since 2021, I didn't knew if it was ok to just add a comment or if I needed to create a new one
- 主要言語
- TypeScript
- スター
- 516
- フォーク
- 134
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
api-platform/admin のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
api-platform/admin#616 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
api-platform/admin#660 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
api-platform/admin#659 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
api-platform/admin#631 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
api-platform/admin#626 · コメント 1 件 · リアクション 1 件 ·
api-platform/admin の issue をすべて見る
似ている issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
Mend: dependency security vulnerability untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100