mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 11:52:00 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
43
odoo-bringout-oca-queue-queue_job/queue_job/exception.py
Normal file
43
odoo-bringout-oca-queue-queue_job/queue_job/exception.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Copyright 2012-2016 Camptocamp
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
|
||||
class BaseQueueJobError(Exception):
|
||||
"""Base queue job error"""
|
||||
|
||||
|
||||
class JobError(BaseQueueJobError):
|
||||
"""A job had an error"""
|
||||
|
||||
|
||||
class NoSuchJobError(JobError):
|
||||
"""The job does not exist."""
|
||||
|
||||
|
||||
class FailedJobError(JobError):
|
||||
"""A job had an error having to be resolved."""
|
||||
|
||||
|
||||
class RetryableJobError(JobError):
|
||||
"""A job had an error but can be retried.
|
||||
|
||||
The job will be retried after the given number of seconds. If seconds is
|
||||
empty, it will be retried according to the ``retry_pattern`` of the job or
|
||||
by :const:`odoo.addons.queue_job.job.RETRY_INTERVAL` if nothing is defined.
|
||||
|
||||
If ``ignore_retry`` is True, the retry counter will not be increased.
|
||||
"""
|
||||
|
||||
def __init__(self, msg, seconds=None, ignore_retry=False):
|
||||
super().__init__(msg)
|
||||
self.seconds = seconds
|
||||
self.ignore_retry = ignore_retry
|
||||
|
||||
|
||||
# TODO: remove support of NothingToDo: too dangerous
|
||||
class NothingToDoJob(JobError):
|
||||
"""The Job has nothing to do."""
|
||||
|
||||
|
||||
class ChannelNotFound(BaseQueueJobError):
|
||||
"""A channel could not be found"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue