Handle subprocess error with more information

This commit is contained in:
Kristóf Tóth 2019-04-07 19:37:00 +02:00
parent 1bc5ec5b73
commit 44497c7364

View File

@ -21,7 +21,7 @@ func New(word, fromLang, toLang string) transJob {
func (tj transJob) Translate() []string {
outBytes, err := tj.execTrans()
if err != nil {
log.Fatal("Failed to execute command 'trans'!")
log.Fatalf("Failed to execute command 'trans': %v", err)
}
return uniqueSlice(parseTransOutput(string(outBytes)))
}