You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.go 651B

12345678910111213141516171819202122232425
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package process
  4. import "fmt"
  5. // Error is a wrapped error describing the error results of Process Execution
  6. type Error struct {
  7. PID IDType
  8. Description string
  9. Err error
  10. CtxErr error
  11. Stdout string
  12. Stderr string
  13. }
  14. func (err *Error) Error() string {
  15. return fmt.Sprintf("exec(%s:%s) failed: %v(%v) stdout: %s stderr: %s", err.PID, err.Description, err.Err, err.CtxErr, err.Stdout, err.Stderr)
  16. }
  17. // Unwrap implements the unwrappable implicit interface for go1.13 Unwrap()
  18. func (err *Error) Unwrap() error {
  19. return err.Err
  20. }