code.gitea.io/gitea@v1.19.3/modules/process/error.go (about)

     1  // Copyright 2022 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package process
     5  
     6  import "fmt"
     7  
     8  // Error is a wrapped error describing the error results of Process Execution
     9  type Error struct {
    10  	PID         IDType
    11  	Description string
    12  	Err         error
    13  	CtxErr      error
    14  	Stdout      string
    15  	Stderr      string
    16  }
    17  
    18  func (err *Error) Error() string {
    19  	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)
    20  }
    21  
    22  // Unwrap implements the unwrappable implicit interface for go1.13 Unwrap()
    23  func (err *Error) Unwrap() error {
    24  	return err.Err
    25  }