Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.py 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from __future__ import absolute_import
  2. try:
  3. from multiprocessing import (
  4. ProcessError,
  5. BufferTooShort,
  6. TimeoutError,
  7. AuthenticationError,
  8. )
  9. except ImportError:
  10. class ProcessError(Exception): # noqa
  11. pass
  12. class BufferTooShort(Exception): # noqa
  13. pass
  14. class TimeoutError(Exception): # noqa
  15. pass
  16. class AuthenticationError(Exception): # noqa
  17. pass
  18. class TimeLimitExceeded(Exception):
  19. """The time limit has been exceeded and the job has been terminated."""
  20. def __str__(self):
  21. return "TimeLimitExceeded%s" % (self.args, )
  22. class SoftTimeLimitExceeded(Exception):
  23. """The soft time limit has been exceeded. This exception is raised
  24. to give the task a chance to clean up."""
  25. def __str__(self):
  26. return "SoftTimeLimitExceeded%s" % (self.args, )
  27. class WorkerLostError(Exception):
  28. """The worker processing a job has exited prematurely."""
  29. class Terminated(Exception):
  30. """The worker processing a job has been terminated by user request."""
  31. class RestartFreqExceeded(Exception):
  32. """Restarts too fast."""
  33. class CoroStop(Exception):
  34. """Coroutine exit, as opposed to StopIteration which may
  35. mean it should be restarted."""
  36. pass