Remove headless9 binary from source tree
This commit is contained in:
parent
0c661756fe
commit
9b52bb9b47
10
main.go
10
main.go
@ -43,6 +43,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func execCommand(cmd string, arg ...string) {
|
func execCommand(cmd string, arg ...string) {
|
||||||
|
defer PanicSafe()
|
||||||
proc := exec.Command(cmd, arg...)
|
proc := exec.Command(cmd, arg...)
|
||||||
// open the out file for writing
|
// open the out file for writing
|
||||||
outfile, err := os.Create(fmt.Sprintf("/adm/log/%+v.log", cmd))
|
outfile, err := os.Create(fmt.Sprintf("/adm/log/%+v.log", cmd))
|
||||||
@ -104,3 +105,12 @@ func watchFile(filePath string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// PanicSafe is a deferrable function to recover from a panic operation.
|
||||||
|
func PanicSafe(a ...interface{}) {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
log.Printf("Panic detected: %+v", r)
|
||||||
|
log.Printf("Optional panic data: %+v", a...)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user