Skip to content

Commit 3819f27

Browse files
committed
Better error message in failed upload
1 parent 592bbdc commit 3819f27

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commands/upload/upload.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/arduino/arduino-cli/commands"
2929
"github.com/arduino/arduino-cli/common/formatter"
3030
"github.com/arduino/arduino-cli/executils"
31-
"github.com/arduino/go-paths-helper"
31+
paths "github.com/arduino/go-paths-helper"
3232
properties "github.com/arduino/go-properties-orderedmap"
3333
"github.com/sirupsen/logrus"
3434
"github.com/spf13/cobra"
@@ -208,9 +208,10 @@ func run(command *cobra.Command, args []string) {
208208

209209
uploadProperties.SetPath("build.path", importPath)
210210
uploadProperties.Set("build.project_name", importFile)
211-
if _, err := importPath.Join(importFile + ext).Stat(); err != nil {
211+
uploadFile := importPath.Join(importFile + ext)
212+
if _, err := uploadFile.Stat(); err != nil {
212213
if os.IsNotExist(err) {
213-
formatter.PrintErrorMessage("Compiled sketch not found. Please compile first.")
214+
formatter.PrintErrorMessage("Compiled sketch not found: " + uploadFile.String() + ". Please compile first.")
214215
} else {
215216
formatter.PrintError(err, "Could not open compiled sketch.")
216217
}

0 commit comments

Comments
 (0)