setup user/auth repository and service
This commit is contained in:
parent
8db61212d9
commit
0ae9cd7133
7 changed files with 249 additions and 4 deletions
15
internal/exception/exception.go
Normal file
15
internal/exception/exception.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package exception
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Exception struct {
|
||||
Operation string
|
||||
}
|
||||
|
||||
func New(operation string) *Exception {
|
||||
return &Exception{Operation: operation}
|
||||
}
|
||||
|
||||
func (e *Exception) WithError(err error) error {
|
||||
return fmt.Errorf("%s: %w", e.Operation, err)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue