Class ExceptionHelper

java.lang.Object
com.oracle.communications.brm.cc.util.ExceptionHelper

public class ExceptionHelper extends Object
Handles exception. If exception is validation exception, it generates and sends validation error details.
  • Constructor Details

    • ExceptionHelper

      public ExceptionHelper()
      Creates a ExceptionHelper instance.
  • Method Details

    • buildErrorInfo

      public static void buildErrorInfo(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 caller
      Parameters:
      errorCode - Trinity Specific Error Code
      errorMessage - Error description for the error code
      params - 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

      public static void handleException(ApplicationException apExp)
      Handles exceptions other than EBufException
      Parameters:
      apExp - exception to handle
    • getRootCause

      public static Throwable getRootCause(Throwable throwable)
      Iterates recursively to get the root exception and the message
      Parameters:
      throwable - Throwable instance
      Returns:
      root cause