{"modulePath":"github.com/xmlking/toolkit","version":"v0.5.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Functions\n\n```go\nfunc GetCategory(err error) categories.Category\n```\n\n```go\nfunc GetCode(err error) codes.Code\n```\n\n```go\nfunc GetOperation(err error) string\n```\n\n```go\nfunc New(c codes.Code, operation string, msg string) error\n```\nNew constructors are for creating Leaf errors\n\n```go\nfunc Newf(c codes.Code, operation string, format string, a ...interface{}) error\n```\n\n```go\nfunc WithCode(err error, code codes.Code) error\n```\nWrapper constructors are for wrapping additional traits to previous error WithCode adds code to an existing error.\n\n```go\nfunc WithCodeAndOperation(err error, code codes.Code, operation string) error\n```\nWithCodeAndOperation adds code and operation to an existing error.\n\n```go\nfunc WithOperation(err error, operation string) error\n```\nWithOperation adds operation to an existing error.\n\n## Types\n\n```go\ntype ErrorCoder interface {\n\terror\n\tCode() codes.Code\n\tCategory() categories.Category\n}\n```\nErrorHinter is implemented by types that can provide Machine-readable error code.\n\n```go\ntype ErrorOperation interface {\n\terror\n\tOperation() string\n}\n```\nErrorOperation is implemented by types that can provide Logical Operation that caused the failure\n\n","path":"github.com/xmlking/toolkit/errors","name":"errors","synopsis":"","isRedistributable":true}
