mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Update BE http errors to be ui friendly (#1994)
* chore: More UI friendly errors Mainly capitlization + messages prefix error
This commit is contained in:
+4
-1
@@ -202,7 +202,10 @@ func (e *Error) Error() string {
|
||||
if e.Helper != "" {
|
||||
_, _ = fmt.Fprintf(&builder, ": %s", e.Helper)
|
||||
}
|
||||
for _, err := range e.Errors {
|
||||
if e.Detail != "" {
|
||||
_, _ = fmt.Fprintf(&builder, "\n\tError: %s", e.Detail)
|
||||
}
|
||||
for _, err := range e.Validations {
|
||||
_, _ = fmt.Fprintf(&builder, "\n\t%s: %s", err.Field, err.Detail)
|
||||
}
|
||||
return builder.String()
|
||||
|
||||
Reference in New Issue
Block a user