Unverified Commit 74dd9078 authored by MatteoPologruto's avatar MatteoPologruto Committed by GitHub

[skip-changelog] Handle errors that occur during reset (#2183)

parent ba534c0d
......@@ -131,8 +131,8 @@ func Reset(portToTouch string, wait bool, cb *ResetProgressCallbacks, dryRun boo
if dryRun {
// do nothing!
} else {
if err := TouchSerialPortAt1200bps(portToTouch); err != nil {
fmt.Println(tr("TOUCH: error during reset: %s", err))
if err := TouchSerialPortAt1200bps(portToTouch); err != nil && !wait {
return "", errors.Errorf(tr("TOUCH: error during reset: %s", err))
}
}
}
......
......@@ -430,7 +430,7 @@ func runProgramAction(pme *packagemanager.Explorer,
}
if newPortAddress, err := serialutils.Reset(portToTouch, wait, cb, dryRun); err != nil {
outStream.Write([]byte(fmt.Sprintln(tr("Cannot perform port reset: %s", err))))
errStream.Write([]byte(fmt.Sprintln(tr("Cannot perform port reset: %s", err))))
} else {
if newPortAddress != "" {
actualPort.Address = newPortAddress
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment