snapcraft snap with an unexisting dir shows a traceback
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
In Progress
|
Medium
|
Sergio Schvezov |
Bug Description
To reproduce, run:
⟫ snapcraft snap idontexist
Traceback (most recent call last):
File "/snap/
load_
File "/snap/
return get_distributio
File "/snap/
return ep.load()
File "/snap/
return self.resolve()
File "/snap/
module = __import_
File "/snap/
run(
File "/snap/
return self.main(*args, **kwargs)
File "/snap/
rv = self.invoke(ctx)
File "/snap/
return _process_
File "/snap/
return ctx.invoke(
File "/snap/
return callback(*args, **kwargs)
File "/snap/
project_
File "/snap/
snap = _snap_data_
File "/snap/
with open(os.
FileNotFoundError: [Errno 2] No such file or directory: '/home/
This should show a nicer message.
Changed in snapcraft: | |
status: | New → Confirmed |
Changed in snapcraft: | |
status: | Confirmed → Triaged |
Changed in snapcraft: | |
importance: | Undecided → Medium |
status: | Triaged → In Progress |
assignee: | nobody → Sergio Schvezov (sergiusens) |
milestone: | none → 2.35 |
Changed in snapcraft: | |
milestone: | 2.35 → none |
I'd suggest raising SnapcraftEnviro nmentError( "The directory idontexist doesn't contain a file meta/snap.yaml. If you meant to build a snap in the given folder, cd into the folder instead and re-run Snapcraft."
and ideally also checking the existence of the folder separately for most clarity.