com.tosan.tools.tracker.starter.service.ExceptionHandlerUtil Maven / Gradle / Ivy
The newest version!
package com.tosan.tools.tracker.starter.service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
import java.util.Map;
/**
* @author M.khoshnevisan
* @since 8/27/2023
*/
public class ExceptionHandlerUtil {
private final ObjectMapper objectMapper = new ObjectMapper();
public Map getExceptionParam(T object) {
return jsonToMap(objectToJsonForRestException(object, IgnoredExceptionProperties.class));
}
private Map jsonToMap(String jsonString) {
try {
TypeReference