better recovery in unexpected situations
This commit is contained in:
parent
4014747712
commit
fffdce2c58
@ -178,7 +178,10 @@ func connectToRabbitMQ(log *log.Logger, server url.URL, topics []string) chan Ra
|
||||
func ProcessEvent(f RequestProcessor, request *Request) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println(r)
|
||||
log.Println("panic caught")
|
||||
if err, ok := r.(error); !ok {
|
||||
log.Println(err)
|
||||
}
|
||||
log.Println(string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
"math/rand"
|
||||
"path"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -44,6 +45,16 @@ func CreateDefaultStateChecker(checkOnStart bool, processor *RequestProcessor, g
|
||||
}
|
||||
|
||||
func (s *DefaultStateChecker) VerifyProjectState(org string, configs []*common.AutogitConfig, idx int) error {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println("panic caught")
|
||||
if err, ok := r.(error); !ok {
|
||||
log.Println(err)
|
||||
}
|
||||
log.Println(string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
|
||||
git, err := s.git.CreateGitHandler(GitAuthor, GitEmail, AppName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Cannot create git handler: %w", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user