Skip to content

Commit 094ff2c

Browse files
Merge pull request #5
improved error handling
2 parents 2605862 + 7ce7193 commit 094ff2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"errors"
45
"flag"
56
"fmt"
67
"io/fs"
@@ -161,6 +162,11 @@ func runRSGain(audioFiles []string, isQuiet bool) error {
161162
err := cmd.Run()
162163

163164
if err != nil {
165+
if errors.Is(err, exec.ErrNotFound) {
166+
fmt.Println("autogain can't find rsgain")
167+
fmt.Println("rsgain is not installed and/or not in PATH! Please install it and make it runnable from CLI.")
168+
os.Exit(127)
169+
}
164170
errLog.Printf("Error calling rsgain on these files: '%v'\n", audioFiles)
165171
errLog.Printf("Command failed: %s\nError: %v\n", cmd.String(), err)
166172

0 commit comments

Comments
 (0)