Documentation ¶
Index ¶
- Constants
- Variables
- type DbError
- func (e *DbError) Error() string
- func (e *DbError) Is(target error) bool
- func (e *DbError) Unwrap() error
- func (e *DbError) With(msg string) *DbError
- func (e *DbError) WithContext(ctx context.Context) *DbError
- func (e *DbError) WithMap(kvMap map[ErrorContextKey]string) *DbError
- func (e *DbError) WithValue(key ErrorContextKey, value string) *DbError
- func (e *DbError) Wrap(err error) *DbError
- type ErrorContextKey
Constants ¶
View Source
const ( ENV_VAR = ErrorContextKey("EnvVar") VALUE = ErrorContextKey("Value") DB_ADMIN_USERNAME = ErrorContextKey("dbAdminUsername") DB_HOST = ErrorContextKey("dbHost") DB_NAME = ErrorContextKey("dbName") DB_PORT = ErrorContextKey("dbPort") DB_USERNAME = ErrorContextKey("dbUsername") PORT_NUMBER = ErrorContextKey("PortNumber") SQL_STMT = ErrorContextKey("SqlStmt") SSL_MODE = ErrorContextKey("sslMode") TABLE_NAME = ErrorContextKey("TableName") TYPE = ErrorContextKey("Type") DB_ROLE = ErrorContextKey("DbRole") )
Variables ¶
View Source
var ( ErrBaseDb = &DbError{} ErrMissingRoleMapping = ErrBaseDb.With("Missing role mapping for DB table") ErrNotPtrToStructSlice = ErrBaseDb.With("Argument is invalid") ErrInvalidPortNumber = ErrBaseDb.With("Port # is invalid") ErrMissingEnvVar = ErrBaseDb.With("An environment variable is missing or empty") ErrMissingOrgId = ErrBaseDb.With("OrgId is missing in context") ErrConnectingToDb = ErrBaseDb.With("Failed to establish a connection with database") ErrExecutingSqlStmt = ErrBaseDb.With("SQL statement could not be executed") ErrRegisteringStruct = ErrBaseDb.With("Registration of a struct with DAL failed") ErrStartingTx = ErrBaseDb.With("Failed to start a transaction") ErrCommittingTx = ErrBaseDb.With("Failed to commit a transaction") ErrRevisionConflict = ErrBaseDb.With("Blocking update due to outdated revision") ErrMarshalling = ErrBaseDb.With("Cannot marshal proto message to binary") ErrUnmarshalling = ErrBaseDb.With("Cannot unmarshal binary to proto message") ErrOperationNotAllowed = ErrBaseDb.With("Not authorized to perform the operation on other's data") ErrFetchingMetadata = ErrBaseDb.With("Error fetching metadata from GRPC context") ErrTableDoesNotExist = ErrBaseDb.With("Table does not exist") ErrRecordNotFound = ErrBaseDb.With("Unable to locate record") ErrNotPtrToStruct = ErrBaseDb.With("PointerToStruct expected, invalid type provided") ErrAuthContext = ErrBaseDb.With("Error extracting authContext from context") ErrNoAuthContext = ErrBaseDb.With("Permission denied because authContext is missing") ErrNoUserContext = ErrBaseDb.With("Permission denied because userInformation is missing") ErrUserNotAuthorized = ErrBaseDb.With("User is not authorized to access this API") ErrMissingInstanceId = ErrBaseDb.With("Instance ID is not configured in the context") ErrMarkingEnforcementFailed = ErrBaseDb.With("Failed to mark resource's enforcement status") ErrGettingRealizationStatus = ErrBaseDb.With("Failed to get resource's realization status") ErrResourceStillExists = ErrBaseDb.With("Resource still exists") )
Functions ¶
This section is empty.
Types ¶
type ErrorContextKey ¶
type ErrorContextKey string
func (ErrorContextKey) String ¶
func (c ErrorContextKey) String() string
Click to show internal directories.
Click to hide internal directories.