From b3af89f517c7cd0c9b12db4fba56a868b355e631 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Thu, 3 Aug 2023 12:51:35 -0400 Subject: [PATCH] Better error if template does not exist PermissionDenied results in an unhelpful "Got empty response from qubesd" error. (cherry picked from commit 6f16f26310f146304ba55fa4e58d9b64a0335d35) --- qubes/api/admin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qubes/api/admin.py b/qubes/api/admin.py index 65f9efb21..efbb54dfb 100644 --- a/qubes/api/admin.py +++ b/qubes/api/admin.py @@ -1083,8 +1083,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(