From 78fa06aa948ffc859fee49744244a1486cda534b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 17 Dec 2017 19:35:38 +0100 Subject: [PATCH] Log exception details --- datacenterlight/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index cd50610c..36c399de 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -9,7 +9,6 @@ from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ -from oca.pool import WrongIdError from dynamicweb.celery import app from hosting.models import HostingOrder, HostingBill @@ -273,6 +272,12 @@ def delete_vm_task(self, user_id, vm_id): if return_value is False: raise Exception("Could not delete vm {}".format(vm_id)) except Exception as e: + logger.error( + "An exception occurred while deleting VM {vm_id}. Details " + "below".format( + vm_id=vm_id + ) + ) logger.error(str(e)) try: retry_task(self)