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

io.tarantool.driver.exceptions.errors.TarantoolErrorFactory Maven / Gradle / Ivy

Go to download

Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework

There is a newer version: 0.14.0
Show newest version
package io.tarantool.driver.exceptions.errors;

import io.tarantool.driver.exceptions.TarantoolException;
import org.msgpack.value.Value;

import java.util.Optional;

/**
 * A factory that accepts an error and returns a {@link TarantoolException}
 * if this error matches the format of the factory.
 * This is essentially a factory and a chain of responsibility.
 *
 * @author Artyom Dubinin
 */
public interface TarantoolErrorFactory {
    /**
     * Parse the serialized error object and if it matches any of the familiar formats,
     * produce and return a corresponding exception, or an empty {@link Optional} otherwise.
     *
     * @param error error received from Tarantool
     * @return an {@link Optional}, If the format is appropriate, then Optional will not be null
     */
    Optional create(Value error);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy