Skip to content

Incorrect error details when the LoadSketchRequest fails with NOT_FOUND error #1797

Closed
@kittaakos

Description

@kittaakos

Describe the problem

If I have such a gRPC LoadSketchRequest:

{
    "instance": {
        "id": 1
    },
    "sketchPath": "/Users/a.kitta/Documents/Arduino/alma"
}

And the folder is missing from the file system:

 % cd ~/Documents/Arduino/alma
cd: no such file or directory: /Users/a.kitta/Documents/Arduino/alma

Then the request correctly fails with a NOT_FOUND status code but the error details is incorrect:

{
    "code": 5,
    "details": "Can't open sketch: no valid sketch found in /Users/a.kitta/Documents/Arduino: missing /Users/a.kitta/Documents/Arduino/Arduino.ino",
    "metadata": {
        "content-type": [
            "application/grpc"
        ]
    }
}

The error message should be about Arduino/alma/alma.ino and not Arduino/Arduino.ino. The directories.user location exists on my disk:

% ls -al ~/Documents/Arduino 
total 0
drwxr-xr-x  2 a.kitta  staff   64 Jul  8 16:50 .
drwx------+ 5 a.kitta  staff  160 Jul  6 15:46 ..

To reproduce

Screen Shot 2022-07-08 at 17 05 58

Expected behavior

It should complain about ~/Documents/Arduino/alma and not ~/Documents/Arduino/

Arduino CLI version

0.24.0

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions