mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,18 +70,18 @@ func (t *GenerateScreenshotTask) Start(wg *sync.WaitGroup) {
|
||||
}
|
||||
|
||||
if err := SetSceneScreenshot(checksum, coverImageData); err != nil {
|
||||
return fmt.Errorf("Error writing screenshot: %s", err.Error())
|
||||
return fmt.Errorf("error writing screenshot: %v", err)
|
||||
}
|
||||
|
||||
// update the scene cover table
|
||||
if err := qb.UpdateCover(t.Scene.ID, coverImageData); err != nil {
|
||||
return fmt.Errorf("Error setting screenshot: %s", err.Error())
|
||||
return fmt.Errorf("error setting screenshot: %v", err)
|
||||
}
|
||||
|
||||
// update the scene with the update date
|
||||
_, err = qb.Update(updatedScene)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error updating scene: %s", err.Error())
|
||||
return fmt.Errorf("error updating scene: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user