mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
chore: custom error handler with automatic logging
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package types
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
Messages []string
|
||||
Cause error
|
||||
Code int
|
||||
}
|
||||
|
||||
func (err Error) Error() string {
|
||||
return fmt.Sprintf("%v",
|
||||
err.Messages)
|
||||
return fmt.Sprintf("%s",
|
||||
strings.Join(err.Messages, ", "))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user