Improve Template/ISO Failure Status and Error Reporting
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.4k
- 平均マージ
- 6日 19時間
- マージ済み PR(30日)
- 32
説明
### The required feature described as a wish
**Description:**
In the ISO/Templates flow, error responses currently return detailed error messages directly in the status field. This leads to inconsistencies and complicates error handling.
**Proposal:**
Introduce two improvements to the API responses for Templates and ISOs:
1) Standardize the `status` Field for Failures
When any terminal error occurs during the processing of a template or ISO, the `status` field should consistently return `"Failed"`. This provides a clear and unambiguous final state for parsing.
2) Add a Detailed Error Message Field
A new field, named `error_details`, should be added to the Template/ISO API response object.
This field will contain a detailed error string explaining the reason for the failure.
**Example of the response**
Failed download status of the ISO/Template:
```
{
"id": "a1b2c3d4-xxxx-yyyy-zzzz-e5f6g7h8i9j0",
"name": "my-failed-template",
"status": "Failed",
"error_details": "HTTP Server returned 404 (expected 200 OK)",
....
}
```
Successful download status of the ISO/Template:
```
{
"id": "b1b2c3d4-xxxx-yyyy-zzzz-e5f6g7h8i9j1",
"name": "my-template",
"status": "Download Complete",
"error_details": null,
....
}
```
**Benefits:**
- Consistent error structure across ISO/Templates;
- Easier parsing, logging, and UI display of error messages;
- Avoids issues caused by leading/trailing spaces or unexpected values in status.
Tasks:
1) Update ISO/Templates logic to return "Failed" in the `status` field.
2) Return detailed error messages in the `error_details` field.
コントリビューションガイド
調査の方向性
まず、Issue に記載されている ISO/Templates API のレスポンス処理とターミナルのエラーパスを追跡します。すべての失敗レスポンスとダウンロード成功時のレスポンスを確認し、失敗時は詳細なメッセージを error_details に格納した "Failed" を使用し、成功時のレスポンスでは error_details に null 値を使用することを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- api, cloud
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100