Error strings noncapitalized (#1704)

* Fix error string capitalization

Error strings often follow another string. Hence, they should not be
capitalized, unless referencing a name.

* Uncapitalize more error strings

While here, use %v on the error directly, which makes it easier to wrap
the error later with %w if need be.

* Uncapitalize more error strings

While here, rename Url to URL as a nitpick.
This commit is contained in:
SmallCoccinelle
2021-09-08 03:23:10 +02:00
committed by GitHub
parent d2a0a8fe4c
commit e7f6cb22b7
10 changed files with 26 additions and 19 deletions

View File

@@ -656,17 +656,21 @@ func (i *Instance) ValidateStashBoxes(boxes []*models.StashBoxInput) error {
re, err := regexp.Compile("^http.*graphql$")
if err != nil {
return errors.New("Failure to generate regular expression")
return errors.New("failure to generate regular expression")
}
for _, box := range boxes {
if box.APIKey == "" {
//lint:ignore ST1005 Stash-box is a name
return errors.New("Stash-box API Key cannot be blank")
} else if box.Endpoint == "" {
//lint:ignore ST1005 Stash-box is a name
return errors.New("Stash-box Endpoint cannot be blank")
} else if !re.Match([]byte(box.Endpoint)) {
//lint:ignore ST1005 Stash-box is a name
return errors.New("Stash-box Endpoint is invalid")
} else if isMulti && box.Name == "" {
//lint:ignore ST1005 Stash-box is a name
return errors.New("Stash-box Name cannot be blank")
}
}