diff --git a/qubes/api/admin.py b/qubes/api/admin.py index 6f8a316d2..43e8ee469 100644 --- a/qubes/api/admin.py +++ b/qubes/api/admin.py @@ -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(