Skip to content

Commit 8bcaf13

Browse files
authored
Improve error reporting in stm32CubeMX Launch function calls (#270)
1 parent 13a885a commit 8bcaf13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/stm32CubeMX/stm32CubeMX.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func Process(cbuildGenIdxYmlPath, outPath, cubeMxPath string, runCubeMx bool, pi
283283
if utils.FileExists(cubeIocPath) {
284284
pid, err = Launch(cubeIocPath, "")
285285
if err != nil {
286-
return errors.New("generator '" + gParms.ID + "' missing. Install from '" + gParms.DownloadURL + "'")
286+
return fmt.Errorf("failed to launch generator '%s': %w. If not installed, get it from '%s'", gParms.ID, err, gParms.DownloadURL)
287287
}
288288
} else {
289289
projectFile, err = WriteProjectFile(workDir, bridgeParams[0])
@@ -294,7 +294,7 @@ func Process(cbuildGenIdxYmlPath, outPath, cubeMxPath string, runCubeMx bool, pi
294294

295295
pid, err = Launch("", projectFile)
296296
if err != nil {
297-
return errors.New("generator '" + gParms.ID + "' missing. Install from '" + gParms.DownloadURL + "'")
297+
return fmt.Errorf("failed to launch generator '%s': %w. If not installed, get it from '%s'", gParms.ID, err, gParms.DownloadURL)
298298
}
299299
}
300300
// here cubeMX runs

0 commit comments

Comments
 (0)