public class RESTExceptionHandler extends Object
| Constructor and Description |
|---|
RESTExceptionHandler()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
captureCheckedException(FFDCResponseBase response,
OCFCheckedExceptionBase error,
String exceptionClassName)
Set the exception information into the response.
|
protected void |
captureCheckedException(FFDCResponseBase response,
OCFCheckedExceptionBase error,
String exceptionClassName,
Map<String,Object> exceptionProperties)
Set the exception information into the response.
|
void |
captureInvalidParameterException(FFDCResponseBase response,
InvalidParameterException error)
Set the exception information into the response.
|
void |
capturePropertyServerException(FFDCResponseBase response,
PropertyServerException error)
Set the exception information into the response.
|
void |
captureThrowable(FFDCResponseBase response,
Throwable error,
String methodName)
Set the exception information into the response.
|
void |
captureThrowable(FFDCResponseBase response,
Throwable error,
String methodName,
AuditLog auditLog)
Set the exception information into the response.
|
void |
captureUserNotAuthorizedException(FFDCResponseBase response,
UserNotAuthorizedException error)
Set the exception information into the response.
|
void |
detectAndThrowInvalidParameterException(FFDCResponseBase restResult)
Throw an InvalidParameterException if it is encoded in the REST response.
|
void |
detectAndThrowInvalidParameterException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
detectAndThrowPropertyServerException(FFDCResponseBase restResult)
Throw a PropertyServerException if it is encoded in the REST response.
|
void |
detectAndThrowPropertyServerException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
detectAndThrowStandardExceptions(String methodName,
FFDCResponseBase restResult)
Throw an exception if it is encoded in the REST response.
|
void |
detectAndThrowUserNotAuthorizedException(FFDCResponseBase restResult)
Throw an UserNotAuthorizedException if it is encoded in the REST response.
|
void |
detectAndThrowUserNotAuthorizedException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
handleNoRequestBody(String userId,
String methodName,
String serverName)
Manage an unexpected exception
|
void |
handleUnexpectedException(Throwable error,
String methodName,
String serverName,
String serverURL)
Manage an unexpected exception
|
public void handleNoRequestBody(String userId, String methodName, String serverName) throws InvalidParameterException
userId - calling usermethodName - method that caught the exceptionserverName - name of the server being calledInvalidParameterException - exception to report errorpublic void detectAndThrowStandardExceptions(String methodName, FFDCResponseBase restResult) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.InvalidParameterException - one of the parameters is invalid.UserNotAuthorizedException - the user is not authorized to make this request.PropertyServerException - something went wrong with the REST call stack.public void detectAndThrowInvalidParameterException(FFDCResponseBase restResult) throws InvalidParameterException
restResult - response from the rest call. This generated in the remote server.InvalidParameterException - encoded exception from the server@Deprecated public void detectAndThrowInvalidParameterException(String methodName, FFDCResponseBase restResult) throws InvalidParameterException
methodName - calling method.restResult - response from the rest call. This generated in the remote server.InvalidParameterException - encoded exception from the server@Deprecated public void detectAndThrowUserNotAuthorizedException(String methodName, FFDCResponseBase restResult) throws UserNotAuthorizedException
methodName - calling method.restResult - response from the rest call. This generated in the remote server.UserNotAuthorizedException - encoded exception from the server@Deprecated public void detectAndThrowPropertyServerException(String methodName, FFDCResponseBase restResult) throws PropertyServerException
methodName - calling method.restResult - response from the rest call. This generated in the remote server.PropertyServerException - encoded exception from the serverpublic void detectAndThrowPropertyServerException(FFDCResponseBase restResult) throws PropertyServerException
restResult - response from the rest call. This generated in the remote server.PropertyServerException - encoded exception from the serverpublic void detectAndThrowUserNotAuthorizedException(FFDCResponseBase restResult) throws UserNotAuthorizedException
restResult - response from UserNotAuthorizedException encoded exception from the server.UserNotAuthorizedException - encoded exception from the serverpublic void handleUnexpectedException(Throwable error, String methodName, String serverName, String serverURL) throws PropertyServerException
error - unexpected exceptionmethodName - method that caught the exceptionserverName - name of the server being calledserverURL - platform URLPropertyServerException - wrapping exception for the caught exceptionprotected void captureCheckedException(FFDCResponseBase response, OCFCheckedExceptionBase error, String exceptionClassName)
response - REST Responseerror - returned response.exceptionClassName - class name of the exception to recreateprotected void captureCheckedException(FFDCResponseBase response, OCFCheckedExceptionBase error, String exceptionClassName, Map<String,Object> exceptionProperties)
response - REST Responseerror - returned response.exceptionClassName - class name of the exception to recreateexceptionProperties - map of properties stored in the exception to help with diagnosticspublic void captureThrowable(FFDCResponseBase response, Throwable error, String methodName)
response - REST Responseerror - returned responsemethodName - calling methodpublic void captureThrowable(FFDCResponseBase response, Throwable error, String methodName, AuditLog auditLog)
response - REST Responseerror - returned responsemethodName - calling methodauditLog - log location for recording an unexpected exceptionpublic void captureInvalidParameterException(FFDCResponseBase response, InvalidParameterException error)
response - REST Responseerror - returned response.public void capturePropertyServerException(FFDCResponseBase response, PropertyServerException error)
response - REST Responseerror - returned response.public void captureUserNotAuthorizedException(FFDCResponseBase response, UserNotAuthorizedException error)
response - REST Responseerror - returned response.Copyright © 2018–2020 ODPi. All rights reserved.