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

io.milvus.common.utils.ExceptionUtils Maven / Gradle / Ivy

There is a newer version: 2.4.8
Show newest version
package io.milvus.common.utils;

import io.milvus.exception.UnExpectedException;
import io.milvus.param.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ExceptionUtils {
    private static final Logger logger = LoggerFactory.getLogger(ExceptionUtils.class);

    public static void throwUnExpectedException(String msg) {
        logger.error(msg);
        throw new UnExpectedException(msg);
    }

    public static void handleResponseStatus(R r) {
        if (r.getStatus() != R.Status.Success.getCode()) {
            throw new RuntimeException(r.getMessage());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy