Skip to content

Commit 7d93ecf

Browse files
Exit with error when a sketch file is unreadable
When any sketch file that would normally be compiled is unreadable, SketchLoad would previously just silently skip it, leading to potentially unexpected results. It is probably better to just error out and let the user sort out the problem instead. Additionally, this prepares for improving the handling of broken symlinks in the next commit.
1 parent e5f4c95 commit 7d93ecf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: arduino/builder/sketch.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ func SketchLoad(sketchPath, buildPath string) (*sketch.Sketch, error) {
197197
// check if file is readable
198198
f, err := os.Open(path)
199199
if err != nil {
200-
return nil
200+
feedback.Errorf("Failed to open sketch file: %v", err)
201+
os.Exit(errorcodes.ErrGeneric)
201202
}
202203
f.Close()
203204

0 commit comments

Comments
 (0)