{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.0.0-beta","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst (\n\t// Invalid inputs on API calls\n\tBadRequest = \"400\"\n\n\t// Forbidden due to access control issues\n\tForbidden = \"403\"\n\n\t// Not Found (eg chaincode not found)\n\tNotFound = \"404\"\n\n\t// Request timeout (chaincode or ledger)\n\tTimeout = \"408\"\n\n\t// Example, duplicate transactions or replay attacks\n\tConflict = \"409\"\n\n\t// Request for resource is not available. Example, a chaincode has\n\t// been upgraded and the request uses an old version\n\tGone = \"410\"\n\n\t// Payload of the request exceeds allowed size\n\tPayloadTooLarge = \"413\"\n\n\t// Example, marshal/unmarshalling protobuf error\n\tUnprocessableEntity = \"422\"\n\n\t// Protocol version is no longer supported\n\tUpgradeRequired = \"426\"\n\n\t// Internal server errors that are not classified below\n\tInternal = \"500\"\n\n\t// Requested chaincode function has not been implemented\n\tNotImplemented = \"501\"\n\n\t// Requested chaincode is not available\n\tUnavailable = \"503\"\n\n\t// File IO errors\n\tFileIO = \"520\"\n\n\t// Network IO errors\n\tNetworkIO = \"521\"\n)\n```\nA 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](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)\n\n```go\nconst (\n\t// BCCSP is fabic/BCCSP\n\tBCCSP = \"CSP\"\n\n\t// Common is fabric/common\n\tCommon = \"CMN\"\n\n\t// Core is fabric/core\n\tCore = \"COR\"\n\n\t// Event is fabric/events component\n\tEvent = \"EVT\"\n\n\t// Gossip is fabric/gossip\n\tGossip = \"GSP\"\n\n\t// Ledger is fabric/core/ledger\n\tLedger = \"LGR\"\n\n\t// Peer is fabric/peer\n\tPeer = \"PER\"\n\n\t// Orderer is fabric/orderer\n\tOrderer = \"ORD\"\n\n\t// MSP is fabric/msp\n\tMSP = \"MSP\"\n\n\t// ChaincodeSupport is fabric/core/chaincode\n\tChaincodeSupport = \"CCS\"\n\n\t// DeliveryService is fabric/core/deliverservice\n\tDeliveryService = \"CDS\"\n\n\t// SystemChaincode is fabric/core/scc (system chaincode)\n\tSystemChaincode = \"SCC\"\n)\n```\nA set of constants for component codes\n\n```go\nconst MaxCallStackLength = 30\n```\nMaxCallStackLength is the maximum length of the stored call stack\n\n## Types\n\n```go\ntype CallStackError interface {\n\terror\n\tGetStack() string\n\tGetErrorCode() string\n\tGetComponentCode() string\n\tGetReasonCode() string\n\tMessage() string\n\tGenerateStack(bool) CallStackError\n\tWrapError(error) CallStackError\n}\n```\nCallStackError is a general interface for Fabric errors\n\n```go\nfunc Error(componentcode string, reasoncode string, message string, args ...interface{}) CallStackError\n```\nError creates a CallStackError using a specific component code and reason code (no callstack is generated)\n\n```go\nfunc ErrorWithCallstack(componentcode string, reasoncode string, message string, args ...interface{}) CallStackError\n```\nErrorWithCallstack creates a CallStackError using a specific component code and reason code and generates its callstack\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/errors","name":"errors","synopsis":"","isRedistributable":true}
