errors

package
v0.0.0-...-267b159 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Generic errors used across files in repositories/

Postgres-specific implementation of an ErrorTransformer. This errors utility translates postgres application error codes into internal error types. The go postgres driver defines possible error codes here: https://github.com/lib/pq/blob/master/error.go And the postgres standard defines error responses here:

https://www.postgresql.org/docs/current/static/protocol-error-fields.html

Inspired by https://www.codementor.io/tamizhvendan/managing-data-in-golang-using-gorm-part-1-a9cdjb8nb

Implementation of an error transformer for test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInvalidInputError

func GetInvalidInputError(input string) errors.NebulaAdminError

func GetMissingEntityByIDError

func GetMissingEntityByIDError(entityType string) errors.NebulaAdminError

func GetMissingEntityError

func GetMissingEntityError(entityType string, identifier proto.Message) errors.NebulaAdminError

func GetSingletonMissingEntityError

func GetSingletonMissingEntityError(entityType string) errors.NebulaAdminError

Types

type ErrorTransformer

type ErrorTransformer interface {
	ToNebulaAdminError(err error) admin_errors.NebulaAdminError
}

Defines the basic error transformer interface that all database types must implement.

func NewPostgresErrorTransformer

func NewPostgresErrorTransformer(scope promutils.Scope) ErrorTransformer

func NewTestErrorTransformer

func NewTestErrorTransformer() ErrorTransformer

Jump to

Keyboard shortcuts

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