gallery: don't be silent about signalled children

This commit is contained in:
Přemysl Eric Janouch 2024-01-20 18:33:17 +01:00
parent 059825f169
commit de0dc58b99
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 9 additions and 2 deletions

11
main.go
View File

@ -1415,7 +1415,11 @@ func syncPostProcess(c *syncContext, info syncFileInfo) error {
case info.err != nil: case info.err != nil:
// * → error // * → error
if ee, ok := info.err.(*exec.ExitError); ok { if ee, ok := info.err.(*exec.ExitError); ok {
syncPrintf(c, "%s: %s", info.fsPath, ee.Stderr) message := string(ee.Stderr)
if message == "" {
message = ee.String()
}
syncPrintf(c, "%s: %s", info.fsPath, message)
} else { } else {
return info.err return info.err
} }
@ -2237,7 +2241,10 @@ func cmdThumbnail(fs *flag.FlagSet, args []string) error {
w, h, err := makeThumbnail(*load, pathImage, pathThumb) w, h, err := makeThumbnail(*load, pathImage, pathThumb)
if err != nil { if err != nil {
if ee, ok := err.(*exec.ExitError); ok { if ee, ok := err.(*exec.ExitError); ok {
return string(ee.Stderr), nil if message = string(ee.Stderr); message != "" {
return message, nil
}
return ee.String(), nil
} }
return "", err return "", err
} }