cloudfoundry / cloudfoundry/cf-java-client
Error Status Codes from Cloud Foundry API V3
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 334
- Forks
- 319
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hello everyone. Currently I am working on contribution for the get() operation for applicatons. The essence of contrubution is to migrate client implementation from v2 CF APIs to v3. In DefaultApplications Java class this method is used for getting Application details:
private static Mono<ApplicationInstancesResponse> getApplicationInstances(CloudFoundryClient
cloudFoundryClient, String applicationId) {
return requestApplicationInstances(cloudFoundryClient, applicationId)
.onErrorResume(ExceptionUtils.statusCode(CF_BUILDPACK_COMPILED_FAILED, CF_INSTANCES_ERROR,
CF_STAGING_NOT_FINISHED, CF_STAGING_TIME_EXPIRED, CF_STAGING_ERROR),
t -> Mono.just(ApplicationInstancesResponse.builder().build()));
}
Here we see the handling of various errors by their status codes. Method ExceptionUtils.statusCode just checks if at least one of the passed codes to this method matches the code returned from the API of the V2.
In the DefaultApplications defined following status codes:
private static final int CF_APP_STOPPED_STATS_ERROR = 200003;
private static final int CF_BUILDPACK_COMPILED_FAILED = 170004;
private static final int CF_INSTANCES_ERROR = 220001;
private static final int CF_SERVICE_ALREADY_BOUND = 90003;
private static final int CF_STAGING_ERROR = 170001;
private static final int CF_STAGING_NOT_FINISHED = 170002;
private static final int CF_STAGING_TIME_EXPIRED = 170007;
I want to ask a question where the list of these codes was taken from?
(I tried to find them in the CF API V2 documentation but didn't find them unfortunately.).
Also, do we have similar list of errors for CF V3 APIs? If we have could please share with me some sources, where I can find them? (I tried to find them there: https://v3-apidocs.cloudfoundry.org/version/3.131.0/index.html#errors) But it is common information about the errors and there we don't have info about the returning errors for a specific API endpoint.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza leyendo el ejemplo getApplicationInstances en DefaultApplications y el comportamiento de ExceptionUtils.statusCode. Compara los códigos de estado V2 enumerados con la documentación de errores de Cloud Foundry API V3 enlazada en el issue y, a continuación, identifica fuentes autorizadas para los errores específicos de cada endpoint. Se considera terminado cuando se documente la fuente o se confirme que no existe ninguna lista equivalente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api
- Tipo de issue
- Documentación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100