public class RESTExceptionHandler extends Object
| Constructor and Description |
|---|
RESTExceptionHandler()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
captureCheckedException(FFDCResponse response,
OCFCheckedExceptionBase error,
String exceptionClassName)
Set the exception information into the response.
|
protected void |
captureCheckedException(FFDCResponse response,
OCFCheckedExceptionBase error,
String exceptionClassName,
Map<String,Object> exceptionProperties)
Set the exception information into the response.
|
void |
captureExceptions(FFDCResponse response,
Throwable error,
String methodName)
Set the exception information into the response.
|
void |
captureExceptions(FFDCResponse response,
Throwable error,
String methodName,
AuditLog auditLog)
Set the exception information into the response.
|
void |
captureInvalidParameterException(FFDCResponse response,
InvalidParameterException error)
Set the exception information into the response.
|
void |
capturePropertyServerException(FFDCResponse response,
PropertyServerException error)
Set the exception information into the response.
|
void |
captureThrowable(FFDCResponse response,
Throwable error,
String methodName)
Set the exception information into the response.
|
void |
captureThrowable(FFDCResponse response,
Throwable error,
String methodName,
AuditLog auditLog)
Deprecated.
|
void |
captureUserNotAuthorizedException(FFDCResponse response,
UserNotAuthorizedException error)
Set the exception information into the response.
|
void |
detectAndThrowInvalidParameterException(FFDCResponse restResult)
Throw an InvalidParameterException if it is encoded in the REST response.
|
void |
detectAndThrowInvalidParameterException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
detectAndThrowPropertyServerException(FFDCResponse restResult)
Throw a PropertyServerException if it is encoded in the REST response.
|
void |
detectAndThrowPropertyServerException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
detectAndThrowStandardExceptions(String methodName,
FFDCResponse restResult)
Throw an exception if it is encoded in the REST response.
|
void |
detectAndThrowUserNotAuthorizedException(FFDCResponse restResult)
Throw an UserNotAuthorizedException if it is encoded in the REST response.
|
void |
detectAndThrowUserNotAuthorizedException(String methodName,
FFDCResponseBase restResult)
Deprecated.
|
void |
handleMissingValue(String parameterName,
String methodName)
Manage an unexpected exception
|
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 handleMissingValue(String parameterName, String methodName) throws InvalidParameterException
parameterName - name of null parameter - use to help locate where the problem ismethodName - method that caught the exceptionInvalidParameterException - exception to report errorpublic void detectAndThrowStandardExceptions(String methodName, FFDCResponse 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(FFDCResponse 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(FFDCResponse restResult) throws PropertyServerException
restResult - response from the rest call. This generated in the remote server.PropertyServerException - encoded exception from the serverpublic void detectAndThrowUserNotAuthorizedException(FFDCResponse 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(FFDCResponse response, OCFCheckedExceptionBase error, String exceptionClassName)
response - REST Responseerror - returned response.exceptionClassName - class name of the exception to recreateprotected void captureCheckedException(FFDCResponse 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(FFDCResponse response, Throwable error, String methodName)
response - REST Responseerror - returned responsemethodName - calling method@Deprecated public void captureThrowable(FFDCResponse response, Throwable error, String methodName, AuditLog auditLog)
response - REST Responseerror - returned responsemethodName - calling methodauditLog - log location for recording an unexpected exceptionpublic void captureExceptions(FFDCResponse response, Throwable error, String methodName)
response - REST Responseerror - returned responsemethodName - calling methodpublic void captureExceptions(FFDCResponse response, Throwable error, String methodName, AuditLog auditLog)
response - REST Responseerror - returned responsemethodName - calling methodauditLog - log location for recording an unexpected exceptionpublic void captureInvalidParameterException(FFDCResponse response, InvalidParameterException error)
response - REST Responseerror - returned response.public void capturePropertyServerException(FFDCResponse response, PropertyServerException error)
response - REST Responseerror - returned response.public void captureUserNotAuthorizedException(FFDCResponse response, UserNotAuthorizedException error)
response - REST Responseerror - returned response.Copyright © 2018–2021 LF AI & Data Foundation. All rights reserved.