{"modulePath":"github.com/operator-framework/api","version":"v0.47.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst (\n\t// LevelWarn is for Errors that should be addressed but do not have to be.\n\tLevelWarn = \"Warning\"\n\t// LevelError is for Errors that must be addressed.\n\tLevelError = \"Error\"\n)\n```\n\n## Types\n\n```go\ntype Error struct {\n\t// Type is the ErrorType string constant that represents the kind of\n\t// error, ex. \"MandatoryStructMissing\", \"I/O\".\n\tType ErrorType\n\t// Level is the severity of the Error.\n\tLevel Level\n\t// Field is the dot-hierarchical YAML path of the missing data.\n\tField string\n\t// BadValue is the field or file that caused an error or warning.\n\tBadValue interface{}\n\t// Detail represents the error message as a string.\n\tDetail string\n}\n```\nError is an implementation of the 'error' interface, which represents a warning or an error in a yaml file.\n\n```go\nfunc ErrFailedValidation(detail string, value interface{}) Error\n```\n\n```go\nfunc ErrFieldMissing(detail string, field string, value interface{}) Error\n```\n\n```go\nfunc ErrIOError(detail string, value interface{}) Error\n```\n\n```go\nfunc ErrInvalidBundle(detail string, value interface{}) Error\n```\n\n```go\nfunc ErrInvalidCSV(detail, csvName string) Error\n```\n\n```go\nfunc ErrInvalidManifestStructure(detail string) Error\n```\n\n```go\nfunc ErrInvalidObject(value interface{}, detail string) Error\n```\n\n```go\nfunc ErrInvalidOperation(detail string, value interface{}) Error\n```\n\n```go\nfunc ErrInvalidPackageManifest(detail string, pkgName string) Error\n```\n\n```go\nfunc ErrInvalidParse(detail string, value interface{}) Error\n```\nTODO: see if more information can be extracted out of 'unmarshall/parsing' errors.\n\n```go\nfunc ErrUnsupportedType(detail string) Error\n```\n\n```go\nfunc NewError(t ErrorType, detail, field string, v interface{}) Error\n```\n\n```go\nfunc NewWarn(t ErrorType, detail, field string, v interface{}) Error\n```\n\n```go\nfunc WarnDeprecatedValidator(detail string) Error\n```\n\n```go\nfunc WarnFailedValidation(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnFieldMissing(detail string, field string, value interface{}) Error\n```\n\n```go\nfunc WarnIOError(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnInvalidBundle(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnInvalidCSV(detail, csvName string) Error\n```\n\n```go\nfunc WarnInvalidManifestStructure(detail string) Error\n```\n\n```go\nfunc WarnInvalidObject(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnInvalidOperation(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnInvalidPackageManifest(detail string, pkgName string) Error\n```\n\n```go\nfunc WarnInvalidParse(detail string, value interface{}) Error\n```\n\n```go\nfunc WarnPropertiesAnnotationUsed(detail string) Error\n```\n\n```go\nfunc WarnUnsupportedType(detail string) Error\n```\n\n```go\nfunc (e Error) Error() string\n```\nError implements the 'error' interface to define custom error formatting.\n\n```go\ntype ErrorType string\n```\nErrorType defines what the error resulted from.\n\n```go\nconst (\n\tErrorInvalidCSV               ErrorType = \"CSVFileNotValid\"\n\tErrorFieldMissing             ErrorType = \"FieldNotFound\"\n\tErrorUnsupportedType          ErrorType = \"FieldTypeNotSupported\"\n\tErrorInvalidParse             ErrorType = \"ParseError\"\n\tErrorIO                       ErrorType = \"FileReadError\"\n\tErrorFailedValidation         ErrorType = \"ValidationFailed\"\n\tErrorInvalidOperation         ErrorType = \"OperationFailed\"\n\tErrorInvalidManifestStructure ErrorType = \"ManifestStructureNotValid\"\n\tErrorInvalidBundle            ErrorType = \"BundleNotValid\"\n\tErrorInvalidPackageManifest   ErrorType = \"PackageManifestNotValid\"\n\tErrorObjectFailedValidation   ErrorType = \"ObjectFailedValidation\"\n\tErrorPropertiesAnnotationUsed ErrorType = \"PropertiesAnnotationUsed\"\n\tErrorDeprecatedValidator      ErrorType = \"DeprecatedValidator\"\n)\n```\n\n```go\ntype Level string\n```\nLevel is the severity of an Error.\n\n```go\ntype ManifestResult struct {\n\t// Name is some piece of information identifying the manifest.\n\tName string\n\t// Errors pertain to issues with the manifest that must be corrected.\n\tErrors []Error\n\t// Warnings pertain to issues with the manifest that are optional to correct.\n\tWarnings []Error\n}\n```\nManifestResult represents verification result for each of the yaml files from the operator manifest.\n\n```go\nfunc (r *ManifestResult) Add(errs ...Error)\n```\nAdd appends errs to r in either r.Errors or r.Warnings depending on an error's Level.\n\n```go\nfunc (r ManifestResult) HasError() bool\n```\nHasError returns true if r has any Errors of Level == LevelError.\n\n```go\nfunc (r ManifestResult) HasWarn() bool\n```\nHasWarn returns true if r has any Errors of Level == LevelWarn.\n\n","path":"github.com/operator-framework/api/pkg/validation/errors","name":"errors","synopsis":"","isRedistributable":true}
