drivererrors

package
v0.0.0-...-84dfa8d Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns true if the given error is a constraint error.

func IsErrLocked

func IsErrLocked(err error) bool

IsErrLocked returns true if the error is locked, or a busy error, then we can't have a extended error code. In those cases, we just return early and prevent error unwrapping for common cases.

func IsErrRetryable

func IsErrRetryable(err error) bool

IsErrRetryable returns true if the given error might be transient and the interaction can be safely retried. See: https://github.com/canonical/go-dqlite/v2/issues/220

func IsError

func IsError(err error) bool

IsError reports if the any type passed to it is a database driver error in Juju. The purpose of this function is so that our domain error masking can assert if a specific error needs to be hidden from layers above that of the domain/state.

func IsErrorTarget

func IsErrorTarget(target any) bool

IsErrorTarget reports if the any type passed to it is a database driver error.

func IsExtendedErrorCode

func IsExtendedErrorCode(err error, code sqlite3.ErrNoExtended) bool

IsExtendedErrorCode returns true if the given error is a dqlite error with the given code. Note: ErrNo means error number, not no error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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