Use fmt.Errorf
This commit is contained in:
parent
45069d4fbb
commit
adb424ea03
11 changed files with 50 additions and 60 deletions
|
@ -1,7 +1,6 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/jpeg"
|
||||
|
@ -183,8 +182,8 @@ func SyncThemes(i Importer) []string {
|
|||
btheme.Image = strings.TrimPrefix(filePath, fic.FilesDir)
|
||||
return nil, nil
|
||||
}); err != nil {
|
||||
errs = append(errs, fmt.Sprintf("%q: unable to import heading image: %s", tdir, err))
|
||||
}
|
||||
errs = append(errs, fmt.Sprintf("%q: unable to import heading image: %s", tdir, err))
|
||||
}
|
||||
}
|
||||
|
||||
var theme fic.Theme
|
||||
|
@ -217,7 +216,7 @@ func ApiListRemoteThemes(_ httprouter.Params, _ []byte) (interface{}, error) {
|
|||
func ApiGetRemoteTheme(ps httprouter.Params, _ []byte) (interface{}, error) {
|
||||
r, errs := BuildTheme(GlobalImporter, ps.ByName("thid"))
|
||||
if r == nil {
|
||||
return r, errors.New(fmt.Sprintf("%q", errs))
|
||||
return r, fmt.Errorf("%q", errs)
|
||||
} else {
|
||||
return r, nil
|
||||
}
|
||||
|
|
Reference in a new issue