Search in sources :

Example 1 with CacheAtomicUpdateTimeoutException

use of org.apache.ignite.cache.CacheAtomicUpdateTimeoutException in project ignite by apache.

the class GridCacheUtils method convertToCacheException.

/**
 * @param e Ignite checked exception.
 * @return CacheException runtime exception, never null.
 */
@NotNull
public static RuntimeException convertToCacheException(IgniteCheckedException e) {
    IgniteClientDisconnectedCheckedException disconnectedErr = e.getCause(IgniteClientDisconnectedCheckedException.class);
    if (disconnectedErr != null) {
        assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
        e = disconnectedErr;
    }
    if (e.hasCause(CacheWriterException.class))
        return new CacheWriterException(U.convertExceptionNoWrap(e));
    if (e instanceof CachePartialUpdateCheckedException)
        return new CachePartialUpdateException((CachePartialUpdateCheckedException) e);
    else if (e instanceof CacheAtomicUpdateTimeoutCheckedException)
        return new CacheAtomicUpdateTimeoutException(e.getMessage(), e);
    else if (e instanceof ClusterTopologyServerNotFoundException)
        return new CacheServerNotFoundException(e.getMessage(), e);
    else if (e instanceof SchemaOperationException)
        return new CacheException(e.getMessage(), e);
    if (e.getCause() instanceof CacheException)
        return (CacheException) e.getCause();
    if (e.getCause() instanceof NullPointerException)
        return (NullPointerException) e.getCause();
    C1<IgniteCheckedException, IgniteException> converter = U.getExceptionConverter(e.getClass());
    return converter != null ? new CacheException(converter.apply(e)) : new CacheException(e);
}
Also used : CacheAtomicUpdateTimeoutException(org.apache.ignite.cache.CacheAtomicUpdateTimeoutException) CacheServerNotFoundException(org.apache.ignite.cache.CacheServerNotFoundException) SchemaOperationException(org.apache.ignite.internal.processors.query.schema.SchemaOperationException) CacheException(javax.cache.CacheException) CachePartialUpdateException(org.apache.ignite.cache.CachePartialUpdateException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) ClusterTopologyServerNotFoundException(org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException) IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException) CacheWriterException(javax.cache.integration.CacheWriterException) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

CacheException (javax.cache.CacheException)1 CacheWriterException (javax.cache.integration.CacheWriterException)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 CacheAtomicUpdateTimeoutException (org.apache.ignite.cache.CacheAtomicUpdateTimeoutException)1 CachePartialUpdateException (org.apache.ignite.cache.CachePartialUpdateException)1 CacheServerNotFoundException (org.apache.ignite.cache.CacheServerNotFoundException)1 IgniteClientDisconnectedCheckedException (org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)1 ClusterTopologyServerNotFoundException (org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException)1 SchemaOperationException (org.apache.ignite.internal.processors.query.schema.SchemaOperationException)1 NotNull (org.jetbrains.annotations.NotNull)1