chore: custom error handler with automatic logging

This commit is contained in:
2025-06-10 17:26:20 +01:00
parent fae46f4bf7
commit 3234e5f4da
9 changed files with 142 additions and 140 deletions
+7 -3
View File
@@ -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, ", "))
}