{"modulePath":"github.com/goledgerdev/cc-tools","version":"v0.9.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Types\n\n```go\ntype CCError struct {\n\t// contains filtered or unexported fields\n}\n```\nCCError struct\n\n```go\nfunc NewCCError(errMsg string, status int32) *CCError\n```\nNewCCError creates a new CCError instance\n\n```go\nfunc WrapError(err error, errMsg string) *CCError\n```\nWrapError stacks an error msg on top of the existing one\n\n```go\nfunc WrapErrorWithStatus(err error, errMsg string, status int32) *CCError\n```\nWrapErrorWithStatus wraps an existing error and adds a status to it\n\n```go\nfunc (c *CCError) Error() string\n```\nImplements the error interface\n\n```go\nfunc (c *CCError) GetErrorResponse() peer.Response\n```\nGetErrorResponse converts an Httperror instance to a peer.Response\n\n```go\nfunc (c *CCError) Message() string\n```\nMessage returns the inner error of a CCError instance\n\n```go\nfunc (c *CCError) Status() int32\n```\nStatus Returns the http status code\n\n```go\ntype ICCError interface {\n\tStatus() int32\n\tMessage() string\n\tGetErrorResponse() peer.Response\n\tError() string\n}\n```\nICCError Interface implements an error interface. It contains the return http status, error message and function It also has a function to convert a response to a peer struct\n\n","path":"github.com/goledgerdev/cc-tools/errors","name":"errors","synopsis":"","isRedistributable":true}
