Skip to content

Commit

Permalink
Merge pull request #340 from pixlise/feature/em-import
Browse files Browse the repository at this point in the history
Attempt to get better BGT failure output
  • Loading branch information
pnemere authored Nov 4, 2024
2 parents 0e4df77 + 3efa69e commit bc5cec3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions api/ws/handlers/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,19 +685,21 @@ func createBeamLocation(rsiPath string, outputBeamLocationPath string, logger lo

cmd := exec.Command(bgtPath+"BGT", bgtPath+"Geometry_PIXL_EM_Landing_25Jan2021.csv", rsiPath, outSurfaceTop, outRXL, outLog)

var out bytes.Buffer
var stderr bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &stderr
// var out bytes.Buffer
// var stderr bytes.Buffer
// cmd.Stdout = &out
// cmd.Stderr = &stderr

// cmd.Stdout = os.Stdout
// cmd.Stderr = os.Stderr
cmd.Dir = bgtPath

if err := cmd.Run(); err != nil {
if out, err := cmd.CombinedOutput(); err != nil {
logger.Infof("CombinedOutput:\n%s", out)
//if err := cmd.Run(); err != nil {
// Dump std out
logger.Infof("BGT stdout:\n" + out.String())
logger.Errorf("BGT stderr:\n" + stderr.String())
// logger.Infof("BGT stdout:\n" + out.String())
// logger.Errorf("BGT stderr:\n" + stderr.String())
return "", "", fmt.Errorf("BGT tool error: %v", err)
}

Expand Down

0 comments on commit bc5cec3

Please sign in to comment.