mirror of
https://git.mills.io/saltyim/saltyim.git
synced 2024-07-03 00:33:38 +00:00
47 lines
764 B
Go
47 lines
764 B
Go
![]() |
package exec
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
type ErrCommandKilled struct {
|
||
|
Err error
|
||
|
Signal syscall.Signal
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandKilled) Is(target error) bool {
|
||
|
if _, ok := target.(*ErrCommandKilled); ok {
|
||
|
return true
|
||
|
}
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandKilled) Error() string {
|
||
|
return fmt.Sprintf("error: command killed: %s", e.Err)
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandKilled) Unwrap() error {
|
||
|
return e.Err
|
||
|
}
|
||
|
|
||
|
type ErrCommandFailed struct {
|
||
|
Err error
|
||
|
Status int
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandFailed) Is(target error) bool {
|
||
|
if _, ok := target.(*ErrCommandFailed); ok {
|
||
|
return true
|
||
|
}
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandFailed) Error() string {
|
||
|
return fmt.Sprintf("error: command failed: %s", e.Err)
|
||
|
}
|
||
|
|
||
|
func (e *ErrCommandFailed) Unwrap() error {
|
||
|
return e.Err
|
||
|
}
|