apache / apache/cloudstack

Improve Template/ISO Failure Status and Error Reporting

Aberta
#11,326 4 comentários 0 reações 0 responsáveis Ver no GitHub
component:templates
Linguagem predominante
Java
Estrelas
3.1k
Forks
1.4k
Merge médio
6d 19h
PRs com merge (30d)
32

Descrição

### 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.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece rastreando o tratamento das respostas da API ISO/Templates e os caminhos de erro do terminal descritos na issue. Verifique cada resposta de falha e a resposta de download bem-sucedido e, em seguida, confirme que as falhas usam "Failed" com a mensagem detalhada em error_details e que as respostas bem-sucedidas usam um valor null para error_details.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
api, cloud
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.