Skip to content

Commit

Permalink
Fix bad error message when board ID part of FQBN is wrong (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza authored Oct 18, 2021
1 parent 10beac7 commit 126bb02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arduino/cores/packagemanager/package_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) (
board := platformRelease.Boards[fqbn.BoardID]
if board == nil {
return targetPackage, platformRelease, nil, nil, nil,
fmt.Errorf(tr("board %s:%s not found"), platformRelease, fqbn.BoardID)
fmt.Errorf(tr("board %s not found"), fqbn.StringWithoutConfig())
}

buildProperties, err := board.GetBuildProperties(fqbn.Configs)
Expand Down
4 changes: 2 additions & 2 deletions i18n/data/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -2444,8 +2444,8 @@ msgid "binary file not found in %s"
msgstr "binary file not found in %s"

#: arduino/cores/packagemanager/package_manager.go:189
msgid "board %s:%s not found"
msgstr "board %s:%s not found"
msgid "board %s not found"
msgstr "board %s not found"

#: commands/board/list.go:41
msgid "board not found"
Expand Down
5 changes: 2 additions & 3 deletions test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def test_compile_using_boards_local_txt(run_command, data_dir):
# Verifies compilation fails because board doesn't exist
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
assert res.failed
assert "Error during build: Error resolving FQBN: board arduino:avr@1.8.3:nessuno not found" in res.stderr
assert "Error during build: Error resolving FQBN: board arduino:avr:nessuno not found" in res.stderr

# Use custom boards.local.txt with made arduino:avr:nessuno board
boards_local_txt = Path(data_dir, "packages", "arduino", "hardware", "avr", "1.8.3", "boards.local.txt")
Expand Down Expand Up @@ -943,8 +943,7 @@ def test_compile_manually_installed_platform_using_boards_local_txt(run_command,
res = run_command(["compile", "--clean", "-b", fqbn, sketch_path])
assert res.failed
assert (
"Error during build: Error resolving FQBN: board arduino-beta-development:avr@1.8.3:nessuno not found"
in res.stderr
"Error during build: Error resolving FQBN: board arduino-beta-development:avr:nessuno not found" in res.stderr
)

# Use custom boards.local.txt with made arduino:avr:nessuno board
Expand Down

0 comments on commit 126bb02

Please sign in to comment.