package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
ComputeDefaultCode looks at the current error object (not its causes) and returns: - the existing code for Error instances - SerializationFailure for roachpb retry errors that can be reported to clients - StatementCompletionUnknown for ambiguous commit errors - InternalError for assertion failures - FeatureNotSupportedError for unimplemented errors.
DangerousStatementf creates a new error for "rejected dangerous statements".
Flatten turns any error into a pgerror with fields populated.
FullError can be used when the hint and/or detail are to be tested.
GetConstraintName attempts to unwrap and find a Severity.
GetPGCode retrieves the error code for an error.
GetPGCodeInternal retrieves a code for the error.
GetSeverity attempts to unwrap and find a Severity.
HasCandidateCode returns tue iff the error or one of its causes has a candidate pg error code.
IsSQLRetryableError returns true if err is retryable.
New creates an error with a code.
Newf creates an Error with a format string.
NewInternalTrackingError instantiates an error meant for use with telemetry.ReportError directly.
NewWithDepthf creates an error with a pg code and extracts the context information at the specified depth level.
WithCandidateCode decorates the error with a candidate postgres error code.
WithConstraintName decorates the error with a severity.
WithSeverity decorates the error with a severity.
Wrap wraps an error and adds a pg error code.
Wrapf wraps an error and adds a pg error code.
WrapWithDepthf wraps an error.
WrongNumberOfPreparedStatements creates new an Error for trying to prepare a query string containing more than one statement.
# Constants
DefaultSeverity is the default severity for decoding severity of errors.
InternalErrorPrefix is prepended on internal errors.
TxnRetryMsgPrefix is the prefix inserted in an error message when flattened.
# Interfaces
ClientVisibleAmbiguousError mirrors kvpb.ClientVisibleAmbiguousError but is defined here to avoid an import cycle.
ClientVisibleRetryError mirrors kvpb.ClientVisibleRetryError but is defined here to avoid an import cycle.