Skip to content

Commit

Permalink
Better error if template does not exist
Browse files Browse the repository at this point in the history
PermissionDenied results in an unhelpful "Got empty response from
qubesd" error.
  • Loading branch information
DemiMarie committed Aug 3, 2023
1 parent fee166e commit 6f16f26
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qubes/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ async def _vm_create(self, vm_type, allow_pool=False,
if self.arg:
if hasattr(vm_class, 'template'):
if self.arg not in self.app.domains:
raise qubes.api.PermissionDenied(
'Template {} does not exist'.format(self.arg))
raise qubes.exc.QubesVMNotFoundError(self.arg)
kwargs['template'] = self.app.domains[self.arg]
else:
raise qubes.exc.QubesValueError(
Expand Down

0 comments on commit 6f16f26

Please sign in to comment.