Add ability to not throw exception when http status code > 399
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza rastreando cómo OpenFeign gestiona las respuestas con códigos de estado HTTP superiores a 399 y dónde se crea la excepción. Determina cómo un llamador podría desactivar ese comportamiento y seguir leyendo la respuesta devuelta. Se considerará terminado cuando exista una opción documentada y utilizable para clientes que gestionan los fallos mediante su entidad de respuesta, con cobertura para códigos de estado superiores a 399.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 9.8k
- Forks
- 2k
- Merge medio
- 1 h 15 min
- PR fusionados (30 d)
- 39
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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.
Más de OpenFeign/feign
-
DefaultAsyncClient never completes the returned future when Client throws ErrorPosiblemente ocupada @hutiefang76 la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Response.charset ignores charset after another Content-Type parameterPosiblemente ocupada @hutiefang76 la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
UriUtils ignores allowReservedCharacters=false when the input has no percent tripletPosiblemente ocupada @hutiefang76 la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Java11 Http2Client loses response header value order and duplicate occurrencesPosiblemente ocupada @hutiefang76 la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Java11 Http2Client rejects documented zero connect and read timeoutsPosiblemente ocupada @hutiefang76 la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de OpenFeign/feign
Issues similares
-
Mend: dependency security vulnerability
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 2 días
-
critical
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement Java macOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
freerouting/freerouting#1079 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día