Class ClientResponseExceptionMapper
java.lang.Object
io.clonecloudstore.common.quarkus.client.utils.ClientResponseExceptionMapper
- All Implemented Interfaces:
org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper<RuntimeException>
@ApplicationScoped
public class ClientResponseExceptionMapper
extends Object
implements org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper<RuntimeException>
Implementation for a @Provider for handling exceptions in case of POST/GET InputStream
-
Field Summary
Fields inherited from interface org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper
DEFAULT_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CcsWithStatusException
getBusinessException
(jakarta.ws.rs.WebApplicationException e) Web Application Exception (Runtime) to Ccs With Status Exception (Exception)int
handleCompletableObject
(SimpleClientAbstract<?> simpleClientAbstract, CompletableFuture<?> completableFuture) jakarta.ws.rs.core.Response
handleCompletableResponse
(CompletableFuture<jakarta.ws.rs.core.Response> completableFuture) boolean
handleUniObject
(SimpleClientAbstract<?> simpleClientAbstract, io.smallrye.mutiny.Uni<?> uni) handleUniObject
(SimpleClientAbstract<?> simpleClientAbstract, io.smallrye.mutiny.Uni<?> uni, InputStream inputStreamOptional) jakarta.ws.rs.core.Response
handleUniResponse
(io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> uni) Default handling for Uni Response (not for InputStream)void
responseToExceptionIfError
(jakarta.ws.rs.core.Response response) Generate a CcsWithStatusException if neededtoThrowable
(jakarta.ws.rs.core.Response response)
-
Constructor Details
-
ClientResponseExceptionMapper
public ClientResponseExceptionMapper()
-
-
Method Details
-
getBusinessException
Web Application Exception (Runtime) to Ccs With Status Exception (Exception) -
handleUniResponse
public jakarta.ws.rs.core.Response handleUniResponse(io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> uni) throws CcsWithStatusException Default handling for Uni Response (not for InputStream)- Parameters:
uni
- the Uni response- Returns:
- the Response if no error
- Throws:
CcsWithStatusException
-
handleCompletableResponse
public jakarta.ws.rs.core.Response handleCompletableResponse(CompletableFuture<jakarta.ws.rs.core.Response> completableFuture) throws CcsWithStatusException - Throws:
CcsWithStatusException
-
responseToExceptionIfError
public void responseToExceptionIfError(jakarta.ws.rs.core.Response response) throws CcsWithStatusException Generate a CcsWithStatusException if needed- Throws:
CcsWithStatusException
-
handleUniObject
public Object handleUniObject(SimpleClientAbstract<?> simpleClientAbstract, io.smallrye.mutiny.Uni<?> uni) throws CcsWithStatusException - Throws:
CcsWithStatusException
-
handleUniObject
public Object handleUniObject(SimpleClientAbstract<?> simpleClientAbstract, io.smallrye.mutiny.Uni<?> uni, InputStream inputStreamOptional) throws CcsWithStatusException - Throws:
CcsWithStatusException
-
handleCompletableObject
public Object handleCompletableObject(SimpleClientAbstract<?> simpleClientAbstract, CompletableFuture<?> completableFuture) throws CcsWithStatusException - Throws:
CcsWithStatusException
-
toThrowable
- Specified by:
toThrowable
in interfaceorg.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper<RuntimeException>
-
handles
- Specified by:
handles
in interfaceorg.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper<RuntimeException>
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfaceorg.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper<RuntimeException>
-