Browse Source

More concrete exception.

pull/81/head
Jairo Llopis 10 years ago
parent
commit
c0167896ff
  1. 4
      cron_run_manually/ir_cron.py

4
cron_run_manually/ir_cron.py

@ -20,7 +20,7 @@
import logging import logging
from openerp import _, api, exceptions, models, SUPERUSER_ID from openerp import _, api, exceptions, models, SUPERUSER_ID
from openerp.tools.safe_eval import safe_eval from openerp.tools.safe_eval import safe_eval
from psycopg2 import OperationalError
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -49,7 +49,7 @@ class Cron(models.Model):
(self.id,), (self.id,),
log_exceptions=False) log_exceptions=False)
except Exception as e:
except OperationalError as e:
# User friendly error if the lock could not be claimed # User friendly error if the lock could not be claimed
if getattr(e, "pgcode", None) == '55P03': if getattr(e, "pgcode", None) == '55P03':
raise exceptions.Warning( raise exceptions.Warning(

Loading…
Cancel
Save