cc.youchain.protocol.exceptions.TransactionException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
YOUChain Common library in JAVA.
package cc.youchain.protocol.exceptions;
import java.util.Optional;
/**
* Transaction timeout exception indicates that we have breached some threshold waiting for a
* transaction to execute.
*/
public class TransactionException extends Exception {
private Optional transactionHash = Optional.empty();
public TransactionException(String message) {
super(message);
}
public TransactionException(String message, String transactionHash) {
super(message);
this.transactionHash = Optional.ofNullable(transactionHash);
}
public TransactionException(Throwable cause) {
super(cause);
}
/**
* Obtain the transaction hash .
* @return optional transaction hash .
*/
public Optional getTransactionHash() {
return transactionHash;
}
}