Package io.mosip.kernel.core.exception
Class ExceptionUtils
- java.lang.Object
-
- io.mosip.kernel.core.exception.ExceptionUtils
-
public final class ExceptionUtils extends Object
This utils contains exception utilities.- Since:
- 1.0.0
- Author:
- Shashank Agrawal, Ritesh Sinha
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildMessage(String message, Throwable cause)Returns an String object that can be used after building the exception stack trace.static List<ServiceError>getServiceErrorList(String responseBody)This method gives service error list for response receive from service.static StringgetStackTrace(Throwable throwable)This method returns the stack tracestatic voidlogRootCause(Throwable exception)
-
-
-
Method Detail
-
buildMessage
public static String buildMessage(String message, Throwable cause)
Returns an String object that can be used after building the exception stack trace.- Parameters:
message- the exception messagecause- the cause- Returns:
- the exception stack
-
getStackTrace
public static String getStackTrace(Throwable throwable)
This method returns the stack trace- Parameters:
throwable- the exception to be added to the list of exception- Returns:
- the stack trace
-
getServiceErrorList
public static List<ServiceError> getServiceErrorList(String responseBody)
This method gives service error list for response receive from service.- Parameters:
responseBody- the service response body.- Returns:
- the list of
ServiceError
-
logRootCause
public static void logRootCause(Throwable exception)
-
-