Class IridaOAuthErrorHandler
- java.lang.Object
-
- org.springframework.web.client.DefaultResponseErrorHandler
-
- ca.corefacility.bioinformatics.irida.repositories.remote.resttemplate.IridaOAuthErrorHandler
-
- All Implemented Interfaces:
org.springframework.web.client.ResponseErrorHandler
public class IridaOAuthErrorHandler extends org.springframework.web.client.DefaultResponseErrorHandler
Error handler for use inOAuthTokenRestTemplate
. Catches HTTP UNAUTHORIZED (401) errors to translate to IridaOAuthExceptions
-
-
Constructor Summary
Constructors Constructor Description IridaOAuthErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleError(org.springframework.http.client.ClientHttpResponse response)
Overriding this method to throw aIridaOAuthException
in case of an HTTP UNAUTHORIZED response.void
setRemoteAPI(RemoteAPI remoteAPI)
Set theRemoteAPI
to return to the caller if an error occurs-
Methods inherited from class org.springframework.web.client.DefaultResponseErrorHandler
getCharset, getHttpStatusCode, getResponseBody, handleError, hasError, hasError, hasError
-
-
-
-
Method Detail
-
handleError
public void handleError(org.springframework.http.client.ClientHttpResponse response) throws java.io.IOException
Overriding this method to throw aIridaOAuthException
in case of an HTTP UNAUTHORIZED response.- Specified by:
handleError
in interfaceorg.springframework.web.client.ResponseErrorHandler
- Overrides:
handleError
in classorg.springframework.web.client.DefaultResponseErrorHandler
- Throws:
java.io.IOException
-
-