errdmn

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errdmn provides custom error types for the domain layer. These error types help in distinguishing between different error scenarios such as validation errors, conflicts, unexpected server errors, and not found errors.

Index

Constants

View Source
const (
	Validation = "Validation"  // Validation error type
	Conflict   = "Conflict"    // Conflict error type
	Unexpected = "ServerError" // Unexpected server error type
	NotFound   = "NotFound"    // Resource not found error type
)

Constants representing different error types.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string // The detailed error message
	// contains filtered or unexported fields
}

Error represents a custom domain error with a specific type and message.

func NewConflict

func NewConflict(message string) *Error

NewConflict creates a new conflict error with the given message.

func NewNotFound

func NewNotFound(message string) *Error

NewNotFound creates a new not found error with the given message.

func NewUnexpected

func NewUnexpected(message string) *Error

NewUnexpected creates a new unexpected server error with the given message.

func NewValidation

func NewValidation(message string) *Error

NewValidation creates a new validation error with the given message.

func (Error) Error

func (e Error) Error() string

Error returns the string representation of the Error.

func (Error) Type

func (e Error) Type() string

Type returns the type of the Error.

Jump to

Keyboard shortcuts

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