All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shixinke.utils.web.annotation.cat.ExceptionHandler Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
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;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy