Handle subprocess error with more information
This commit is contained in:
		@@ -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)))
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user