com.scalar.db.sql.springdata.exception.ScalarDbTransientException Maven / Gradle / Ivy
package com.scalar.db.sql.springdata.exception;
import javax.annotation.Nullable;
import org.springframework.dao.TransientDataAccessException;
/**
* An exception thrown from Spring Data JDBC for ScalarDB. when a transient error happens. This
* exception should be retried.
*/
public class ScalarDbTransientException extends TransientDataAccessException {
@Nullable private final String transactionId;
public ScalarDbTransientException(String msg) {
this(msg, null, null);
}
public ScalarDbTransientException(String msg, Throwable cause, @Nullable String transactionId) {
super(msg, cause);
this.transactionId = transactionId;
}
@Nullable
public String getTransactionId() {
return transactionId;
}
@Override
public String getMessage() {
return String.format("%s. transactionID:%s", super.getMessage(), transactionId);
}
}