tech.ydb.yoj.repository.db.exception.UnavailableException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoj-repository Show documentation
Show all versions of yoj-repository Show documentation
Core YOJ (YDB ORM for Java) abstractions and APIs for domain entities, repositories, transactions etc.
package tech.ydb.yoj.repository.db.exception;
import lombok.Getter;
public class UnavailableException extends RepositoryException {
@Getter
public final boolean alreadyRetried;
public UnavailableException(String message) {
super(message);
this.alreadyRetried = false;
}
public UnavailableException(String message, Throwable cause) {
this(message, cause, false);
}
public UnavailableException(String message, Throwable cause, boolean alreadyRetried) {
super(message, cause);
this.alreadyRetried = alreadyRetried;
}
public static UnavailableException afterRetries(String message, Throwable cause) {
return new UnavailableException(message, cause, true);
}
}