Skip to content

Panic when no arguments passed via HELLO command #32

Closed
@olvap80

Description

@olvap80

Describe the problem

Command without parameters leads to cryptic runtime error when called without parameters and developer skills are required to find out what is really wrong:

HELLO
panic: runtime error: slice bounds out of range [6:5]

goroutine 1 [running]:
github.com/arduino/pluggable-discovery-protocol-handler/v2.(*Server).Run(0xc0000f8000, 0xee7158, 0xc0000d8000, 0xee7178, 0xc0000d8008, 0xf96120, 0x0)
        /go/pkg/mod/github.com/arduino/pluggable-discovery-protocol-handler/v2@v2.0.2/discovery.go:135 +0x73f
main.main()
        /home/build/main.go:39 +0xfd

To reproduce

Issue command without parameters

Expected behavior

User friendly error message is expected with direct reference to https://github.com/arduino/serial-discovery

serial-discovery version

serial-discovery Version: v1.3.2 Commit: c5cf4d8 Date: 2022-02-22T08:48:19Z

Operating system

Windows

Operating system version

Windows 10

Additional context

The issue was discovered when trying to use serial-discovery tool as a part of the Arduino IDE

Issue checklist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions