Documentation
¶
Index ¶
- func IsQvmError(err error) bool
- func SuggestClose(query string, candidates []string, maxResults int) []string
- type Code
- type QvmError
- func New(code Code, message string) *QvmError
- func Newf(code Code, format string, args ...any) *QvmError
- func SuggestArch(bad string, available []string) *QvmError
- func SuggestModule(bad string, available []string) *QvmError
- func SuggestVersion(bad string, available []string) *QvmError
- func Wrap(code Code, cause error, message string) *QvmError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsQvmError ¶
IsQvmError reports whether err or any error in its chain is a *QvmError.
Types ¶
type Code ¶
type Code string
Code identifies the category of a qvm error.
const ( CodeUnknownVersion Code = "UNKNOWN_VERSION" CodeUnknownArch Code = "UNKNOWN_ARCH" CodeUnknownModule Code = "UNKNOWN_MODULE" CodeNetworkError Code = "NETWORK_ERROR" CodeExtractError Code = "EXTRACT_ERROR" CodeChecksumError Code = "CHECKSUM_ERROR" CodeNotInstalled Code = "NOT_INSTALLED" CodeAlreadyInstalled Code = "ALREADY_INSTALLED" CodeNoModules Code = "NO_MODULES" CodeConfigError Code = "CONFIG_ERROR" CodeIOError Code = "IO_ERROR" )
type QvmError ¶
QvmError is the structured error type for qvm.
func SuggestArch ¶
SuggestArch produces suggestions when an arch string is unknown.
func SuggestModule ¶
SuggestModule produces suggestions when a module name is unknown.
func SuggestVersion ¶
SuggestVersion produces suggestions when a version string is unknown.
func (*QvmError) WithSuggestions ¶
WithSuggestions returns a copy of the error with additional suggestions.
Click to show internal directories.
Click to hide internal directories.