com.shixinke.utils.web.annotation.cat.ExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web-utils Show documentation
Show all versions of web-utils Show documentation
Toolbox commonly used in web development
package com.shixinke.utils.web.annotation.cat;
/**
* Exception handler
* @author shixinke
*/
public interface ExceptionHandler {
/**
* handle
* @param ex the object of exception
* @param message the defined message
* @param clz the class of the parameter
* @return T
*/
public default T handle(Exception ex, String message, Class clz) {
try {
T obj = clz.newInstance();
return obj;
} catch (Exception e) {
return null;
}
}
}