Class ExceptionHelper
java.lang.Object
com.oracle.communications.brm.cc.util.ExceptionHelper
Handles exception. If exception is validation exception, it generates and
sends validation error details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildErrorInfo(long errorCode, String errorMessage, Object... params) Builds Trinity Error object 'ErrorInfo' for the known BRM Exceptions and returns the error object as part of response to the callerstatic ThrowablegetRootCause(Throwable throwable) Iterates recursively to get the root exception and the messagestatic voidHandles exceptions other than EBufException
-
Constructor Details
-
ExceptionHelper
public ExceptionHelper()Creates a ExceptionHelper instance.
-
-
Method Details
-
buildErrorInfo
Builds Trinity Error object 'ErrorInfo' for the known BRM Exceptions and returns the error object as part of response to the caller- Parameters:
errorCode- Trinity Specific Error CodeerrorMessage- Error description for the error codeparams- Optional Parameters that need to be built as part of error object The parameters that can be set are Response status,boolean value to indicate a validation error, error flist or a list of 'ParamInfo' objects. Parameters should be passed in the order mentioned above. Default Response status for known BRM Exceptions will be 400(Bad Request)
-
handleException
Handles exceptions other than EBufException- Parameters:
apExp- exception to handle
-
getRootCause
Iterates recursively to get the root exception and the message- Parameters:
throwable- Throwable instance- Returns:
- root cause
-