mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
genbindings/clang: bubble error handling for retry
This commit is contained in:
parent
3a274ec9c5
commit
697e1fc488
@ -39,27 +39,22 @@ func clangExec(ctx context.Context, clangBin, inputHeader string, cflags []strin
|
|||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
var inner []interface{}
|
var inner []interface{}
|
||||||
|
var innerErr error
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
inner, innerErr = clangStripUpToFile(pr, inputHeader)
|
||||||
inner__, err := clangStripUpToFile(pr, inputHeader)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
inner = inner__
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
err = cmd.Wait()
|
err = cmd.Wait()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return nil, fmt.Errorf("Command: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
return inner, nil
|
return inner, innerErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustClangExec(ctx context.Context, clangBin, inputHeader string, cflags []string) []interface{} {
|
func mustClangExec(ctx context.Context, clangBin, inputHeader string, cflags []string) []interface{} {
|
||||||
@ -71,6 +66,7 @@ func mustClangExec(ctx context.Context, clangBin, inputHeader string, cflags []s
|
|||||||
log.Printf("WARNING: Clang execution failed: %v", err)
|
log.Printf("WARNING: Clang execution failed: %v", err)
|
||||||
time.Sleep(ClangRetryDelay)
|
time.Sleep(ClangRetryDelay)
|
||||||
log.Printf("Retrying...")
|
log.Printf("Retrying...")
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success
|
// Success
|
||||||
|
Loading…
Reference in New Issue
Block a user