exec.mx raw

   1  package exec
   2  
   3  import "os"
   4  
   5  // An ExitError reports an unsuccessful exit by a command.
   6  type ExitError struct {
   7  	*os.ProcessState
   8  
   9  	// Stderr holds a subset of the standard error output from the
  10  	// Cmd.Output method if standard error was not otherwise being
  11  	// collected.
  12  	//
  13  	// If the error output is long, Stderr may contain only a prefix
  14  	// and suffix of the output, with the middle replaced with
  15  	// text about the number of omitted bytes.
  16  	//
  17  	// Stderr is provided for debugging, for inclusion in error messages.
  18  	// Users with other needs should redirect Cmd.Stderr as needed.
  19  	Stderr []byte
  20  }
  21  
  22  func (e *ExitError) Error() string {
  23  	return e.ProcessState.String()
  24  }
  25