aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-01-21 15:49:49 +0100
committerRon Evans <[email protected]>2020-01-27 19:46:53 +0100
commit46ccb6793ef97fc68a92930a5013cff930cfad29 (patch)
tree30f0cd17db0a44589f988d1134c607d116445ffc /main.go
parent15c7d93ea9d36f63260cce74fcd3b695b0b06724 (diff)
downloadtinygo-46ccb6793ef97fc68a92930a5013cff930cfad29.tar.gz
tinygo-46ccb6793ef97fc68a92930a5013cff930cfad29.zip
main: differentiate between various serial/USB error messages
This way it is possible to determine the source of an error when it happens.
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index 5c6fdb3c1..363afff69 100644
--- a/main.go
+++ b/main.go
@@ -598,7 +598,7 @@ func getDefaultPort() (port string, err error) {
}
if out.String() == "No Instance(s) Available." {
- return "", errors.New("unable to locate a USB device to be flashed")
+ return "", errors.New("no serial ports available")
}
for _, line := range strings.Split(out.String(), "\n") {
@@ -609,7 +609,7 @@ func getDefaultPort() (port string, err error) {
}
}
}
- return "", errors.New("unable to locate a USB device to be flashed")
+ return "", errors.New("unable to locate a serial port")
default:
return "", errors.New("unable to search for a default USB device to be flashed on this OS")
}
@@ -619,7 +619,7 @@ func getDefaultPort() (port string, err error) {
return "", err
}
if d == nil {
- return "", errors.New("unable to locate a USB device to be flashed")
+ return "", errors.New("unable to locate a serial port")
}
return d[0], nil