Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorageError ¶
func NewStorageError(errorType StorageErrorType, err error) error
newStorageError takes an SQL error and returns a corresponding storage error
func NewStorageErrorFromError ¶
NewStorageErrorFromError is a helper function to easily handle a error received during interacting with an sql engine. It will try to find the correct StorageErrorType and populate a StorageError accordingly.
Types ¶
type StorageError ¶
type StorageError struct { Type StorageErrorType Message string WrappedError error }
ErrorResponse is a generic response type for errors in HTTP requests
func (*StorageError) Error ¶
func (storageError *StorageError) Error() string
type StorageErrorType ¶
type StorageErrorType string
const ( NotFoundError StorageErrorType = "Not Found Error" ForeignKeyViolation StorageErrorType = "Foreign Key Violation" InternalError StorageErrorType = "Internal Error" AlreadyExistsError StorageErrorType = "Already exists error" // AccessDeniedError is returned when the user is trying to access an entity which it doesn't control AccessDeniedError StorageErrorType = "Access Denied Error" )
Click to show internal directories.
Click to hide internal directories.