Package org.hyperledger.fabric.gateway
Class ContractException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.hyperledger.fabric.gateway.GatewayException
-
- org.hyperledger.fabric.gateway.ContractException
-
- All Implemented Interfaces:
java.io.Serializable
public class ContractException extends GatewayException
Thrown when an error occurs invoking a smart contract.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContractException(java.lang.String message)
Constructs a new exception with the specified detail message.ContractException(java.lang.String message, byte[] payload)
Deprecated.ContractException(java.lang.String message, java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause.ContractException(java.lang.String message, java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse> proposalResponses)
Constructs a new exception with the specified detail message and proposal responses returned from peer invocations.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Optional<byte[]>
getPayload()
Deprecated.java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse>
getProposalResponses()
Get the proposal responses received from peer invocations.void
setProposalResponses(java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse> proposalResponses)
Set the proposal responses received from peer invocations.
-
-
-
Constructor Detail
-
ContractException
public ContractException(java.lang.String message)
Constructs a new exception with the specified detail message. The cause, payload and proposal responses are not initialized.- Parameters:
message
- the detail message.
-
ContractException
public ContractException(java.lang.String message, java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause. The payload and proposal responses are not initialized.- Parameters:
message
- the detail message.cause
- the cause.
-
ContractException
@Deprecated public ContractException(java.lang.String message, byte[] payload)
Deprecated.Constructs a new exception with the specified detail message and response payload. The cause and proposal responses are not initialized.- Parameters:
message
- the detail message.payload
- the error response payload.
-
ContractException
public ContractException(java.lang.String message, java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse> proposalResponses)
Constructs a new exception with the specified detail message and proposal responses returned from peer invocations. The cause and payload are not initialized.- Parameters:
message
- the detail message.proposalResponses
- the proposal responses.
-
-
Method Detail
-
getPayload
@Deprecated public java.util.Optional<byte[]> getPayload()
Deprecated.Get the error response payload received from the smart contract.- Returns:
- the response payload.
-
getProposalResponses
public java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse> getProposalResponses()
Get the proposal responses received from peer invocations.- Returns:
- the proposal responses.
-
setProposalResponses
public void setProposalResponses(java.util.Collection<org.hyperledger.fabric.sdk.ProposalResponse> proposalResponses)
Set the proposal responses received from peer invocations.- Parameters:
proposalResponses
- the proposal responses.
-
-