Bootstrap copied BFF and local accounts with public Sendico contracts (#34)

This commit is contained in:
Stephan D committed 2026-09-12 13:37:48 +02:00
1 parent 67dc5b5b1e
commit 7062672a87
556 files changed
+42291 -777

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
package merrors
import "strings"
type classifiedError struct {
base error
code error
msg string
reason string
publicMessage bool
argumentNames []string
}
func (e classifiedError) Error() string {
if e.publicMessage {
msg := strings.TrimSpace(e.msg)
if msg != "" {
return msg
}
if e.code != nil {
return e.code.Error()
}
if e.base != nil {
return e.base.Error()
}
return ""
}
return Wrap(e.base, e.msg).Error()
}
func (e classifiedError) Unwrap() []error {
causes := make([]error, 0, 2)
if e.base != nil {
causes = append(causes, e.base)
}
if e.code != nil {
causes = append(causes, e.code)
}
return causes
}
func (e classifiedError) Reason() string {
return strings.TrimSpace(e.reason)
}
func (e classifiedError) InvalidArgumentFields() []string {
return append([]string(nil), e.argumentNames...)
}