* TP-51709| created mark-duplicate-incident-status function * TP-51709| made the duplicate status code modular
46 lines
809 B
Go
46 lines
809 B
Go
package customErrors
|
|
|
|
type CustomError struct {
|
|
Message string
|
|
}
|
|
|
|
func NewCustomError(message string) error {
|
|
return &CustomError{Message: message}
|
|
}
|
|
|
|
func (e *CustomError) Error() string {
|
|
return e.Message
|
|
}
|
|
|
|
type DataAccessError struct {
|
|
CustomError
|
|
}
|
|
|
|
func NewDataAccessError(message string) error {
|
|
return &DataAccessError{CustomError{Message: message}}
|
|
}
|
|
|
|
type NotFoundError struct {
|
|
CustomError
|
|
}
|
|
|
|
func NewNotFoundError(message string) error {
|
|
return &NotFoundError{CustomError{Message: message}}
|
|
}
|
|
|
|
type InvalidInputError struct {
|
|
CustomError
|
|
}
|
|
|
|
func NewInvalidInputError(message string) error {
|
|
return &InvalidInputError{CustomError{Message: message}}
|
|
}
|
|
|
|
type SlackError struct {
|
|
CustomError
|
|
}
|
|
|
|
func NewSlackError(message string) error {
|
|
return &SlackError{CustomError{Message: message}}
|
|
}
|