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 ...@@ -131,8 +131,8 @@ func Reset(portToTouch string, wait bool, cb *ResetProgressCallbacks, dryRun boo
if dryRun { if dryRun {
// do nothing! // do nothing!
} else { } else {
if err := TouchSerialPortAt1200bps(portToTouch); err != nil { if err := TouchSerialPortAt1200bps(portToTouch); err != nil && !wait {
fmt.Println(tr("TOUCH: error during reset: %s", err)) return "", errors.Errorf(tr("TOUCH: error during reset: %s", err))
} }
} }
} }
......
...@@ -430,7 +430,7 @@ func runProgramAction(pme *packagemanager.Explorer, ...@@ -430,7 +430,7 @@ func runProgramAction(pme *packagemanager.Explorer,
} }
if newPortAddress, err := serialutils.Reset(portToTouch, wait, cb, dryRun); err != nil { 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 { } else {
if newPortAddress != "" { if newPortAddress != "" {
actualPort.Address = 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