{"modulePath":"github.com/G-core/gcore-cli","version":"v0.3.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar ErrAborted = errors.New(\"operation aborted\")\n```\n\n## Types\n\n```go\ntype CliError struct {\n\n\t// The original error that triggers this CLI error.\n\t// The Err.String() will be print in red to the user.\n\tErr error\n\n\t// Message allow to override the red message shown to the use.\n\t// By default, we will use Err.String() but in same case you may want to keep Err\n\t// to avoid loosing detail in json output.\n\tMessage string\n\n\tDetails string\n\tHint    string\n\n\t// Code allows to return a specific error code from the main binary.\n\tCode int\n\n\t// Empty tells the marshaler to not print any message for the error\n\tEmpty bool\n}\n```\nCliError is an all-in-one error structure that can be used in commands to return useful errors to the user. CliError implements JSON and human marshaler for a smooth experience.\n\n```go\nfunc ParseCloudErr(body []byte) *CliError\n```\nTODO: It's not CLI work. SDK should do it.\n\n```go\nfunc (s *CliError) Error() string\n```\n\n```go\nfunc (s *CliError) MarshalHuman() (string, error)\n```\n\n```go\nfunc (s *CliError) MarshalJSON() ([]byte, error)\n```\n\n","path":"github.com/G-core/gcore-cli/internal/errors","name":"errors","synopsis":"","isRedistributable":true}
