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

fun.fengwk.convention4j.example.code.ThrowableErrorCodeExample Maven / Gradle / Ivy

package fun.fengwk.convention4j.example.code;

import fun.fengwk.convention4j.api.code.ErrorCode;
import fun.fengwk.convention4j.common.util.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author fengwk
 */
public class ThrowableErrorCodeExample {

    private static final Logger log = LoggerFactory.getLogger(ThrowableErrorCodeExample.class);

    public static void main(String[] args) {
        ErrorCode errorCode = ExampleErrorCodes.EXAMPLE_ERROR.resolve(MapUtils.newMap("name", "fengwk"));
        log.warn("发生了示例错误, 上下文信息是balabala...");
        throw errorCode.asThrowable();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy