Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Invalid inputs on API calls BadRequest = "400" // Forbidden due to access control issues Forbidden = "403" // Not Found (eg chaincode not found) NotFound = "404" // Request timeout (chaincode or ledger) Timeout = "408" // Example, duplicate transactions or replay attacks Conflict = "409" // Request for resource is not available. Example, a chaincode has // been upgraded and the request uses an old version Gone = "410" // Payload of the request exceeds allowed size PayloadTooLarge = "413" // Example, marshal/unmarshalling protobuf error UnprocessableEntity = "422" // Protocol version is no longer supported UpgradeRequired = "426" // Internal server errors that are not classified below Internal = "500" // Requested chaincode function has not been implemented NotImplemented = "501" Unavailable = "503" // File IO errors FileIO = "520" // Network IO errors NetworkIO = "521" )
A set of constants for error reason codes, which is based on HTTP codes http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
View Source
const ( // BCCSP is fabic/BCCSP BCCSP = "CSP" // Common is inkchain/common Common = "CMN" // Core is inkchain/core Core = "COR" // Event is inkchain/events component Event = "EVT" // Gossip is inkchain/gossip Gossip = "GSP" // Ledger is inkchain/core/ledger Ledger = "LGR" // Peer is inkchain/peer Peer = "PER" // Orderer is inkchain/orderer Orderer = "ORD" // MSP is inkchain/msp MSP = "MSP" // ChaincodeSupport is inkchain/core/chaincode ChaincodeSupport = "CCS" // DeliveryService is inkchain/core/deliverservice DeliveryService = "CDS" // SystemChaincode is inkchain/core/scc (system chaincode) SystemChaincode = "SCC" )
A set of constants for component codes
View Source
const MaxCallStackLength = 30
MaxCallStackLength is the maximum length of the stored call stack
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallStackError ¶
type CallStackError interface { error GetStack() string GetErrorCode() string GetComponentCode() string GetReasonCode() string Message() string GenerateStack(bool) CallStackError WrapError(error) CallStackError }
CallStackError is a general interface for Inkchain errors
func Error ¶
func Error(componentcode string, reasoncode string, message string, args ...interface{}) CallStackError
Error creates a CallStackError using a specific component code and reason code (no callstack is generated)
func ErrorWithCallstack ¶
func ErrorWithCallstack(componentcode string, reasoncode string, message string, args ...interface{}) CallStackError
ErrorWithCallstack creates a CallStackError using a specific component code and reason code and generates its callstack
Click to show internal directories.
Click to hide internal directories.