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

com.scalar.db.sql.springdata.exception.ScalarDbNonTransientException Maven / Gradle / Ivy

package com.scalar.db.sql.springdata.exception;

import javax.annotation.Nullable;
import org.springframework.dao.NonTransientDataAccessException;

/**
 * An exception thrown from Spring Data JDBC for ScalarDB when a non-transient error happens. This
 * exception should not be retried.
 */
public class ScalarDbNonTransientException extends NonTransientDataAccessException {

  @Nullable protected final String transactionId;

  public ScalarDbNonTransientException(String msg) {
    this(msg, null, null);
  }

  public ScalarDbNonTransientException(
      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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy