canonical / canonical/multipass
Better error message when launching fails
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**What are you trying to do?**
launch a vm to test changes for a pr related to sbuild docs on 24.04
**What's your proposed solution?**
I tried to run the following command to clearly differentiate between test environments.
```
$ multipass launch 24.04 --name sbuild-docs-24.04
launch failed: Invalid arguments supplied
Invalid instance name supplied: sbuild-docs-24.04
```
**Additional context**
The problem here is that the error message does not tell me what I need to do to make it work.
A great error message consists of three parts.
- What happened?
- Why did it happen?
- How do I fix it?
The current error message only covers the first part, and leaves the user in the dark about why exactly it failed and what a viable solution might be.
A better error message would be
```
Invalid instance name: 'sbuild-docs-24.04'
Instance names may contain only:
- letters
- numbers
- hyphens
Dots (.) are not allowed.
Try:
multipass launch 24.04 --name sbuild-docs-2404
```
Actually, I made this up... checking https://documentation.ubuntu.com/multipass/stable/reference/instance-name-format/ - it is even a bit more strict. We could even link to that document in case you do not want to include the whole description in the error message.
Contributor guide
Research direction
Reproduce the failure with `multipass launch 24.04 --name sbuild-docs-24.04`, then trace the instance-name validation used by the launch command. Use the instance-name-format documentation linked in the issue as the reference; done means the error explains the permitted format and a viable correction or documentation link.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100