diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index 3e4086d922..5fe955c471 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -38,14 +38,14 @@ Validate collects error strings in a slice and returns this */ func (a ActorID) Validate() []string { - err := make([]string, 0, 3) // ToDo: Solve this dynamically + var err = []string{} - if res := a.validate_is_not_empty(a.schema, "schema"); res != nil { - err = append(err, res.Error()) + if res := validate_is_not_empty(a.schema); res != nil { + err = append(err, strings.Join([]string{res.Error(), "for schema field"}, " ")) } - if res := a.validate_is_not_empty(a.host, "host"); res != nil { - err = append(err, res.Error()) + if res := validate_is_not_empty(a.host); res != nil { + err = append(err, strings.Join([]string{res.Error(), "for host field"}, " ")) } switch a.source {