From 44497c7364f89a24d26a0682eafed538d5408b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 7 Apr 2019 19:37:00 +0200 Subject: [PATCH] Handle subprocess error with more information --- trans/trans.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trans/trans.go b/trans/trans.go index 3889964..1340d5d 100644 --- a/trans/trans.go +++ b/trans/trans.go @@ -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))) }