Help us shape the future of Go! Take the 2026 Go Developer Survey

cherr

package
v1.34.0-profiles1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cherr holds the ClickHouse adapter error type and the one error-code registry that the driver, the client, Lookout and the grants reference share.

Index

Constants

View Source
const (
	CodeConfigInvalid         = "CH_CONFIG_INVALID"
	CodeCAInvalid             = "CH_CA_INVALID"
	CodeWorkspaceNotEnabled   = "CH_WORKSPACE_NOT_ENABLED"
	CodeHostNotAllowed        = "CH_HOST_NOT_ALLOWED"
	CodeDNSFailed             = "CH_DNS_FAILED"
	CodeRedirectRefused       = "CH_REDIRECT_REFUSED"
	CodeSortingKeyUnavailable = "CH_SORTING_KEY_UNAVAILABLE"

	CodeTLS         = "CH_TLS"
	CodeRateLimited = "CH_RATE_LIMITED"

	CodeClusterUnsupported      = "CH_CLUSTER_UNSUPPORTED"
	CodeVersionBelowFloor       = "CH_VERSION_BELOW_FLOOR"
	CodeCatalogUnsupported      = "CH_CATALOG_UNSUPPORTED"
	CodeCrossDatabaseMove       = "CH_CROSS_DATABASE_MOVE_UNSUPPORTED"
	CodeTransactionsUnsupported = "CH_TRANSACTIONS_UNSUPPORTED"
	CodePrepareUnsupported      = "CH_PREPARE_UNSUPPORTED"
	CodeTypeUnsupported         = "CH_TYPE_UNSUPPORTED"

	CodeInvalidReference  = "CH_INVALID_REFERENCE"
	CodeInvalidIdentifier = "CH_INVALID_IDENTIFIER"
	CodeQueryInvalid      = "CH_QUERY_INVALID"

	CodeObjectNotFound = "CH_OBJECT_NOT_FOUND"

	CodeValueEncoding   = "CH_VALUE_ENCODING"
	CodeDuplicateColumn = "CH_DUPLICATE_COLUMN"
	CodeCountOverflow   = "CH_COUNT_OVERFLOW"

	CodeDDLNotVisible    = "CH_DDL_NOT_VISIBLE"
	CodeRowCountMismatch = "CH_ROW_COUNT_MISMATCH"
	CodeBaselineMissing  = "CH_BASELINE_MISSING"
	CodeSchemaMismatch   = "CH_SCHEMA_MISMATCH"
	CodeLostResponse     = "CH_LOST_RESPONSE"
	CodeOutcomeUnknown   = "CH_OUTCOME_UNKNOWN"

	CodeScratchCleanupFailed = "CH_SCRATCH_CLEANUP_FAILED"

	CodeAuthentication = "CH_AUTHENTICATION"
	CodePermission     = "CH_PERMISSION"
	CodeTimeout        = "CH_TIMEOUT"
	CodeResource       = "CH_RESOURCE"
	CodeNetwork        = "CH_NETWORK"
	CodeCancelled      = "CH_CANCELLED"
	CodeUnavailable    = "CH_UNAVAILABLE"
	CodeUnknown        = "CH_UNKNOWN"
)

Variables

This section is empty.

Functions

func Category

func Category(code string) string

Category returns the registry category of code, or "unknown" for a code outside the registry.

func Codes

func Codes() []string

Codes returns every registry code, sorted.

Types

type Error

type Error struct {
	Code, Field, Detail string
	ServerCode          int32
	RetryAfter          time.Duration
	// contains filtered or unexported fields
}

Error is an adapter error. Its text is built from bounded fields only; the cause stays reachable through errors.Is and errors.As but is never printed, because a server message can echo SQL text or credentials.

func New

func New(code, field, detail string) *Error

func Wrap

func Wrap(code, field, detail string, cause error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Format

func (e *Error) Format(f fmt.State, verb rune)

Format prints only Error() for every verb, so %+v and %#v never expose the cause or the struct fields.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL